Skip to content
Permalink
Browse files

Fix displaying SELF privileges on alternative group classes

  • Loading branch information...
flack committed Mar 27, 2019
1 parent f16f44f commit 31a7a6e0ee9bd9dcef7448a0912cdc5eb4d929fb
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/midcom/datamanager/extension/type/privilegeType.php
@@ -65,11 +65,12 @@ private function get_effective_value(array $options, FormInterface $form)
return $defaults[$options['privilege_name']] === MIDCOM_PRIVILEGE_ALLOW;
}
if ($options['assignee'] == 'SELF') {
if ($object instanceof \midcom_db_group) {
//There's no sane way to query group privileges in auth right now, so we only return defaults
if (midcom::get()->dbfactory->is_a($object, 'midgard_group')) {
// There's no sane way to query group privileges in auth right now, so we only return defaults
$defaults = midcom::get()->auth->acl->get_default_privileges();
return (($defaults[$options['privilege_name']] === MIDCOM_PRIVILEGE_ALLOW));
return $defaults[$options['privilege_name']] === MIDCOM_PRIVILEGE_ALLOW;
}
return midcom::get()->auth->can_user_do($options['privilege_name'],
new midcom_core_user($object->id), $options['classname']);
}

0 comments on commit 31a7a6e

Please sign in to comment.
You can’t perform that action at this time.