Skip to content

Update syntax to pass role_type to acl#19

Merged
mfornet merged 1 commit into
near:masterfrom
mooori:acl-role-syntax
Oct 18, 2022
Merged

Update syntax to pass role_type to acl#19
mfornet merged 1 commit into
near:masterfrom
mooori:acl-role-syntax

Conversation

@mooori
Copy link
Copy Markdown
Contributor

@mooori mooori commented Oct 17, 2022

Currently passing the role_type argument into #[access_control] requires quotes around Role:

#[access_control(role_type = "Role")]
#[near_bindgen]
#[derive(Default, BorshDeserialize, BorshSerialize)]
pub struct Contract { /* ... */ }

Requiring quotes around the identifier looks not so nice.

After this update the quotes can be omitted and the syntax changes to:

#[access_control(role_type(Role))]

@mooori mooori marked this pull request as ready for review October 17, 2022 09:06
@mfornet mfornet self-requested a review October 17, 2022 12:06
@mfornet mfornet merged commit 5721332 into near:master Oct 18, 2022
@mooori mooori deleted the acl-role-syntax branch October 19, 2022 06:44
@sept-en sept-en added the enhancement New feature or request label Oct 26, 2022
This was referenced Mar 27, 2026
@github-actions github-actions Bot mentioned this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants