mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-26 07:02:08 +01:00
"new method acl::get_location_grants(), jaytraxx was missing ;-)"
This commit is contained in:
parent
699e66a1ce
commit
c772e1d57d
@ -735,4 +735,29 @@ class acl
|
|||||||
),__LINE__,__FILE__);
|
),__LINE__,__FILE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the locations for an app (excluding the run location !!!)
|
||||||
|
*
|
||||||
|
* @param string $location location, can contain wildcards % or ?
|
||||||
|
* @param string $app app optional defaults to $GLOBALS['egw_info']['flags']['currentapp'];
|
||||||
|
* @return array with location => array(account => rights) pairs
|
||||||
|
*/
|
||||||
|
function get_location_grants($location,$app='')
|
||||||
|
{
|
||||||
|
if (!$app) $app = $GLOBALS['egw_info']['flags']['currentapp'];
|
||||||
|
|
||||||
|
$locations = array();
|
||||||
|
foreach($this->db->select(acl::TABLE,'acl_location,acl_account,acl_rights',array(
|
||||||
|
'acl_appname' => $app,
|
||||||
|
'acl_location LIKE '.$this->db->quote($location),
|
||||||
|
),__LINE__,__FILE__) as $row)
|
||||||
|
{
|
||||||
|
if (($location = $row['acl_location']) != 'run')
|
||||||
|
{
|
||||||
|
$locations[$location][$row['acl_account']] = $row['acl_rights'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $locations;
|
||||||
|
}
|
||||||
} //end of acl class
|
} //end of acl class
|
||||||
|
Loading…
Reference in New Issue
Block a user