Near-One / near-plugins

Implementation of common patterns used for NEAR smart contracts.
Creative Commons Zero v1.0 Universal
27 stars 12 forks source link

Update syntax to pass `role_type` to acl #19

Closed mooori closed 1 year ago

mooori commented 1 year ago

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))]