Currently, the ACL plugin provides api to init single super admin by acl_init_super_admin. But to transfer the admin to another account, the developers need to write their own method, like this:
pub fn transfer_super_admin(&mut self, account_id: AccountId) {
let current_super_admin = env::predecessor_account_id();
near_sdk::require!(
self.acl_get_or_init()
.revoke_super_admin_unchecked(¤t_super_admin),
"Failed to revoke super-admin."
);
near_sdk::require!(
self.acl_get_or_init().init_super_admin(&account_id),
"Failed to init super-admin."
);
}
This pull request adds a default implementation to transfer the super admin permissions to another account, this could be useful for transferring the super admin to DAO or another account, or on migration from one DAO to another.
Currently, the ACL plugin provides api to init single super admin by
acl_init_super_admin
. But to transfer the admin to another account, the developers need to write their own method, like this:This pull request adds a default implementation to transfer the super admin permissions to another account, this could be useful for transferring the super admin to DAO or another account, or on migration from one DAO to another.
Added pubic APIs: