Default permission for custom role

Default permission for custom role

by Akinsaya Delamarre -
Number of replies: 2
Hello,

I have a block that adds a new role and two new capabilities. In my access.php I define the default permissions for the legacy roles. However, I would like to assign default permissions for the new custom role in the access.php.

How would one go about doing so?

example:

$block_<name>_capabilities = array (
'riskbitmast' => <bit_mask>,
'captype' => <type>,
'contextlevel' => <level>,
'legacy' => array (
'guest' => CAP_INHERIT,
'student' => CAP_INHERIT,
'teacher' => CAP_INHERIT,
'editingteacher' => CAP_INHERIT,
'coursecreator' => CAP_INHERIT,
'admin' => CAP_ALLOW,
),
<?What_Next?>
);

Thanks,

Average of ratings: -
In reply to Akinsaya Delamarre

Re: Default permission for custom role

by Vy-Shane Sin Fat -
It can't be done in access.php. Why does the block need to define a new custom role?
In reply to Vy-Shane Sin Fat

Re: Default permission for custom role

by Akinsaya Delamarre -
The addition of a new custom role is done in the block as a convenience when the block is installed. However, we wanted to take it a little further by setting up the permissions for the capabilities, of the new role, at the same time.