forked from extern/egroupware
Nice handling for no read on any categories:
- Short-cut on link query to skip search - no categories means no results - Hide add button - with no categories, user will not be able to save
This commit is contained in:
parent
a23f04ca2f
commit
eb104a9ee5
@ -555,6 +555,13 @@ class resources_bo
|
|||||||
, 'short_description' => $pattern);
|
, 'short_description' => $pattern);
|
||||||
}
|
}
|
||||||
$only_keys = 'res_id,name,short_description,bookable,useable';
|
$only_keys = 'res_id,name,short_description,bookable,useable';
|
||||||
|
|
||||||
|
// If no read access to any category, just stop
|
||||||
|
if(!$this->acl->get_cats(EGW_ACL_READ))
|
||||||
|
{
|
||||||
|
$options['total'] = 0;
|
||||||
|
return array();
|
||||||
|
}
|
||||||
$filter = array(
|
$filter = array(
|
||||||
'cat_id' => array_flip((array)$this->acl->get_cats(EGW_ACL_READ)),
|
'cat_id' => array_flip((array)$this->acl->get_cats(EGW_ACL_READ)),
|
||||||
//'accessory_of' => '-1'
|
//'accessory_of' => '-1'
|
||||||
|
@ -144,9 +144,10 @@ class resources_ui
|
|||||||
$content['nm']['actions'] = $this->get_actions();
|
$content['nm']['actions'] = $this->get_actions();
|
||||||
|
|
||||||
// check if user is permitted to add resources
|
// check if user is permitted to add resources
|
||||||
if(!$this->bo->acl->get_cats(EGW_ACL_ADD))
|
// If they can't read any categories, they won't be able to save it
|
||||||
|
if(!$this->bo->acl->get_cats(EGW_ACL_ADD) || !$this->bo->acl->get_cats(EGW_ACL_READ))
|
||||||
{
|
{
|
||||||
$no_button['add'] = true;
|
$no_button['add'] = $no_button['nm']['add'] = true;
|
||||||
}
|
}
|
||||||
$no_button['back'] = true;
|
$no_button['back'] = true;
|
||||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('resources');
|
$GLOBALS['egw_info']['flags']['app_header'] = lang('resources');
|
||||||
|
Loading…
Reference in New Issue
Block a user