X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPermission.php;h=52cc6f041a4b651017650957e751b60352cd28f5;hb=2efcf0c212127e3281834edf26b64d2bbd5e0bb5;hp=2e7facdfe7b89529bde00fdf3daf17137585a1bf;hpb=c1c4f1e167414705fbceb41881d8f5cf91ca2d63;p=civicrm-core.git diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 2e7facdfe7..52cc6f041a 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -173,7 +173,7 @@ class CRM_Core_Permission { } public static function customGroup($type = CRM_Core_Permission::VIEW, $reset = FALSE) { - $customGroups = CRM_Core_PseudoConstant::customGroup($reset); + $customGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id', array('fresh' => $reset)); $defaultGroups = array(); // check if user has all powerful permission @@ -209,7 +209,7 @@ class CRM_Core_Permission { } public static function ufGroup($type = CRM_Core_Permission::VIEW) { - $ufGroups = CRM_Core_PseudoConstant::ufGroup(); + $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); $allGroups = array_keys($ufGroups); @@ -279,7 +279,11 @@ class CRM_Core_Permission { if (!$eventID) { return $permissionedEvents; } - return array_search($eventID, $permissionedEvents) === FALSE ? NULL : $eventID; + if (!empty($permissionedEvents)){ + return array_search($eventID, $permissionedEvents) === FALSE ? NULL : $eventID; + } else { + return $eventID; + } } static function eventClause($type = CRM_Core_Permission::VIEW, $prefix = NULL) {