You are here

function webfm_path_access in Web File Manager 5

Helper function to determine if a path is accessible by a user with 'access webfm'

3 calls to webfm_path_access()
webfm_file_att_access in ./webfm.module
webfm_file_mod_access in ./webfm.module
Helper function to determine if a webfm_file record is modifiable by a user with 'access webfm'
webfm_file_view_access in ./webfm.module
Helper function to determine if a webfm_file record is viewable by a user with 'access webfm'

File

./webfm.module, line 2023

Code

function webfm_path_access($path) {

  //admins don't call this routine so include webfm root path
  $root_dir = file_directory_path() . webfm_get_root_path();
  $webfm_roots = webfm_get_root_dirs();
  foreach ($webfm_roots as $key => $sub_root) {

    // The read path must be contained within a legitimate role root dir for this user
    if (webfm_check_path($path, $root_dir . $sub_root)) {
      return TRUE;
    }
  }
  return FALSE;
}