mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-12 05:58:51 +01:00
only transfer link-registry for apps user has access too, otherwise mime-registry would open eg. iCal files in calender, even if user has no calendar access
This commit is contained in:
parent
d8c9a194da
commit
d3cd7ea65b
@ -210,6 +210,8 @@ class egw_link extends solink
|
|||||||
* Get clientside relevant attributes from app registry in json format
|
* Get clientside relevant attributes from app registry in json format
|
||||||
*
|
*
|
||||||
* Only transfering relevant information cuts approx. half of the size.
|
* Only transfering relevant information cuts approx. half of the size.
|
||||||
|
* Also only transfering information relevant to apps user has access too.
|
||||||
|
* Important eg. for mime-registry, to not use calendar for opening iCal files, if user has no calendar!
|
||||||
*
|
*
|
||||||
* @return string json encoded object with app: object pairs with attributes "(view|add|edit)(|_id|_popup)"
|
* @return string json encoded object with app: object pairs with attributes "(view|add|edit)(|_id|_popup)"
|
||||||
*/
|
*/
|
||||||
@ -218,14 +220,17 @@ class egw_link extends solink
|
|||||||
$to_json = array();
|
$to_json = array();
|
||||||
foreach(self::$app_register as $app => $data)
|
foreach(self::$app_register as $app => $data)
|
||||||
{
|
{
|
||||||
$to_json[$app] = array_intersect_key($data, array_flip(array(
|
if (isset($GLOBALS['egw_info']['user']['apps'][$app]))
|
||||||
'view','view_id','view_popup',
|
{
|
||||||
'add','add_app','add_id','add_popup',
|
$to_json[$app] = array_intersect_key($data, array_flip(array(
|
||||||
'edit','edit_id','edit_popup',
|
'view','view_id','view_popup',
|
||||||
'list','list_popup',
|
'add','add_app','add_id','add_popup',
|
||||||
'name','icon','query',
|
'edit','edit_id','edit_popup',
|
||||||
'mime',
|
'list','list_popup',
|
||||||
)));
|
'name','icon','query',
|
||||||
|
'mime',
|
||||||
|
)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return json_encode($to_json);
|
return json_encode($to_json);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user