You are here

function opigno_lms_update_7106 in Opigno LMS 7

Changes default permissions

File

./opigno_lms.install, line 665
Install, update and uninstall functions for the Opigno LMS installation profile.

Code

function opigno_lms_update_7106(&$sandbox) {
  $roles = user_roles(FALSE, NULL);
  foreach ($roles as $rid => $rolename) {
    if ($rolename == "authenticated user") {
      user_role_grant_permissions($rid, array(
        'access quiz',
      ));
    }
    if ($rolename == "student manager") {
      user_role_grant_permissions($rid, array(
        'score any quiz',
      ));
    }
  }
}