Skip to content

Commit

Permalink
feat: add super admin role to dao
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksuss committed Sep 27, 2024
1 parent 6f17216 commit efe7e99
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,17 @@ impl AuroraControllerFactory {
latest: LazyOption::new(keys::Prefix::LatestRelease, None),
};

contract.acl_init_super_admin(env::current_account_id());
require!(
contract.acl_init_super_admin(env::current_account_id()),
"Failed to init Super Admin role"
);

// Optionally grant `Role::DAO`.
if let Some(account_id) = dao {
let res = contract.acl_add_super_admin(account_id.clone());
require!(Some(true) == res, "Failed to grant Super Admin role");
let res = contract.acl_grant_role(Role::DAO.into(), account_id);
require!(Some(true) == res, "Failed to grant role");
require!(Some(true) == res, "Failed to grant DAO role");
}

contract
Expand Down

0 comments on commit efe7e99

Please sign in to comment.