You are here

function opigno_lms_set_og_permissions in Opigno LMS 7

Set OG permissions for a specific bundle and 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

string $bundle:

array $permissions: An array of permissions, keyed by group role ID. Modules that define group types are encouraged to expose constants for their default group roles so other modules can use this function for the same purpose.

Related topics

File

./opigno_lms.profile, line 525
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_og_permissions($bundle, $permissions) {
  foreach ($permissions as $role_key => $role_permissions) {
    $rid = opigno_lms_get_og_role_id($role_key);
    og_role_grant_permissions($rid, $role_permissions);
  }
}