You are here

function imce_access in IMCE 6

Same name and namespace in other branches
  1. 6.2 imce.module \imce_access()
  2. 7 imce.module \imce_access()

Check if the user has access to imce.

1 call to imce_access()
imce_textarea in ./imce.module
Inline image/link insertion to textareas.
1 string reference to 'imce_access'
imce_menu in ./imce.module
Implementation of hook_menu().

File

./imce.module, line 157

Code

function imce_access($user = FALSE) {
  if ($user === FALSE) {
    global $user;
  }
  if ($user->uid == 1) {
    return TRUE;
  }
  $roles_profiles = variable_get('imce_roles_profiles', array());
  foreach ($user->roles as $rid => $name) {
    if (isset($roles_profiles[$rid]['pid']) && $roles_profiles[$rid]['pid']) {
      return TRUE;
    }
  }
  return FALSE;
}