You are here

function view_profiles_perms_perm in View profiles permissions 6

Implements hook_perm().

Provide permissions per role to be viewed

File

./view_profiles_perms.module, line 13
Restricts viewing user profiles based on user roles

Code

function view_profiles_perms_perm() {
  $perms = array();
  $roles = user_roles(TRUE);

  // remove authenticated role
  unset($roles[2]);
  if (count($roles) > 0) {
    foreach ($roles as $rid => $role_name) {
      $perms[] = view_profiles_perms_permission_name($role_name);
    }
    return $perms;
  }
}