- 🇺🇸United States lwalley
Looks like
PanelizerEntityDefault::panelizer_access()
callsog_user_access()
which will always return TRUE if user has'administer group'
permission.The result of the og access check is always appended to panelizer access regardless of the outcome of
hook_panelizer_access()
, and only one of the access array items needs to be TRUE to grant access.So it seems anyone with
'administer group'
permission will always completely bypass panelizer permissions for an entity that is a group or a member of a group. If that is the case, it is maybe a bit unexpected. Perhaps special consideration is needed for users with'administer group'
access, one option could be to ignore admin permission e.g.:Instead of:
$og_access = og_user_access($this->entity_type, $entity_id, "administer panelizer og_group $op");
Pass in TRUE for $ignore_admin:
$og_access = og_user_access($this->entity_type, $entity_id, "administer panelizer og_group $op", NULL, FALSE, TRUE);
References:
https://git.drupalcode.org/project/panelizer/-/blob/7.x-3.x/plugins/enti...
https://git.drupalcode.org/project/og/-/blob/7.x-2.x/og.module?ref_type=...