You are here

function imce_perm_exists in IMCE 6

Same name and namespace in other branches
  1. 6.2 inc/imce.page.inc \imce_perm_exists()
  2. 7 inc/imce.page.inc \imce_perm_exists()

Check if a permission is given to at least one directory in the list.

2 calls to imce_perm_exists()
imce_content in inc/page.inc
Content of the file browser.
imce_fileop_form in inc/page.inc
File operations form.

File

inc/page.inc, line 872

Code

function imce_perm_exists(&$imce, $perm) {
  static $perms = array();
  if (isset($perms[$perm])) {
    return $perms[$perm];
  }
  if (isset($imce['perm'][$perm]) && $imce['perm'][$perm]) {
    return $perms[$perm] = TRUE;
  }
  foreach ($imce['directories'] as $name => $info) {
    if (isset($info[$perm]) && $info[$perm]) {
      return $perms[$perm] = TRUE;
    }
  }
  return $perms[$perm] = FALSE;
}