*/
CONST EDIT = 1, VIEW = 2, DELETE = 3, CREATE = 4, SEARCH = 5, ALL = 6, ADMIN = 7;
+ /**
+ * A placeholder permission which always fails
+ */
+ const ALWAYS_DENY_PERMISSION = "*always deny*";
+
+ /**
+ * A placeholder permission which always fails
+ */
+ const ALWAYS_ALLOW_PERMISSION = "*always allow*";
+
/**
* get the current permission of this user
*
return TRUE;
}
- if (self::check('administer Multiple Organizations') &&
+ if (
+ self::check('administer Multiple Organizations') &&
self::isMultisiteEnabled()
) {
return TRUE;
}
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
}
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);
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) {
'import contacts' => $prefix . ts('import contacts'),
'edit groups' => $prefix . ts('edit groups'),
'administer CiviCRM' => $prefix . ts('administer CiviCRM'),
+ 'skip IDS check' => $prefix . ts('skip IDS check'),
'access uploaded files' => $prefix . ts('access uploaded files'),
'profile listings and forms' => $prefix . ts('profile listings and forms'),
'profile listings' => $prefix . ts('profile listings'),