You are here

function opigno_lms_set_platform_permissions in Opigno LMS 7

Set platform permissions for specific roles. This function is globally available and modules and apps should use it to set default permissions, simplifying module installation and site management.

Parameters

array $permissions: An array of permissions, keyed by role ID.

Related topics

File

./opigno_lms.profile, line 540
Enables modules and site configuration for a standard site installation. Provides a default API for Apps and modules to use. This will simplify the user experience.

Code

function opigno_lms_set_platform_permissions($permissions) {
  foreach ($permissions as $role_key => $role_permissions) {
    $rid = opigno_lms_get_platform_role_id($role_key);
    user_role_grant_permissions($rid, $role_permissions);
  }
}