Commit 07595b4e authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '6075-acl-detection-fails-for-attributes-in-dynamic-tabs' into '1.4-dev'

Resolve "ACL detection fails for attributes in dynamic tabs"

See merge request fusiondirectory/fd!748
parents d64da26b 6981785a
......@@ -965,7 +965,7 @@ class userinfo
/* Usual workflow */
$infos = objects::infos($type);
$prefix = $infos['aclCategory'].'/';
$tabs = $config->data['TABS'][$infos['tabGroup']];
$tabs = $infos['tabClass']::getPotentialTabList($type, $infos);
}
foreach ($tabs as $tab) {
$acls = pluglist::pluginInfos($tab['CLASS'])['plProvidedAcls'];
......
......@@ -136,6 +136,16 @@ class simpleTabs
}
}
/*!
* \brief Returns the list of tabs which may appear for a given object type
*/
public static function getPotentialTabList (string $type, array $infos): array
{
global $config;
return $config->data['TABS'][$infos['tabGroup']];
}
/*!
* \brief Sets the active tabs from this instance to an other one. Used by templates
*/
......
......@@ -136,6 +136,24 @@ class ogrouptabs extends simpleTabs_noSpecial
return parent::gen_tabs($disabled);
}
/*!
* \brief Returns the list of tabs which may appear for a given object type
*/
public static function getPotentialTabList (string $type, array $infos): array
{
global $config;
/* prefix will be OGROUP- for ogroup */
$tabList = parent::getPotentialTabList($type, $infos);
$prefix = strtoupper($type).'-';
foreach ($config->data['TABS'] as $tabgroup => $tabs) {
if (strpos($tabgroup, $prefix) === 0) {
$tabList = array_merge($tabList, $tabs);
}
}
return $tabList;
}
/*!
* \brief Sets the active tabs from this instance to an other one. Used by templates
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment