CRM_Core_Permission_Base
class CRM_Core_Permission_Base
Properties
$permissions |
Methods
Translate permission.
Get the current permission of this user.
Get the permissioned where clause for the user.
Get the permissioned where clause for the user when trying to see groups.
Get all groups from database, filtered by permissions for this user
Get group clause for this user.
Given a permission string, check for access requirements
Given a roles array, check for access requirements
Get all the contact emails for users that have a specific permission.
Get all the contact emails for users that have a specific role.
Determine whether the permission store allows us to store a list of permissions generated dynamically (eg by hook_civicrm_permissions.)
Ensure that the CMS supports all the permissions defined by CiviCRM and its extensions. If there are stale permissions, they should be deleted. This is useful during module upgrade when the newer module version has removed permission that were defined in the older version.
Get the permissions defined in the hook_civicrm_permission implementation of the given module.
Get the permissions defined in the hook_civicrm_permission implementation in all enabled CiviCRM module extensions.
Details
at line 58
NULL|string
translatePermission(string $perm, string $nativePrefix, array $map)
Translate permission.
at line 82
string
getPermission()
Get the current permission of this user.
at line 99
string
whereClause(int $type, array $tables, array $whereTables)
Get the permissioned where clause for the user.
at line 116
string
getPermissionedStaticGroupClause(int $type, array $tables, array $whereTables)
Get the permissioned where clause for the user when trying to see groups.
at line 134
array
group(string $groupType = NULL, bool $excludeHidden = TRUE)
Get all groups from database, filtered by permissions for this user
at line 151
string
groupClause(int $type, array $tables, array $whereTables)
Get group clause for this user.
at line 162
check(string $str)
Given a permission string, check for access requirements
at line 175
bool
checkGroupRole(array $array)
Given a roles array, check for access requirements
at line 186
permissionEmails(string $permissionName)
Get all the contact emails for users that have a specific permission.
at line 197
roleEmails(string $roleName)
Get all the contact emails for users that have a specific role.
at line 208
bool
isModulePermissionSupported()
Determine whether the permission store allows us to store a list of permissions generated dynamically (eg by hook_civicrm_permissions.)
at line 224
upgradePermissions(array $permissions)
Ensure that the CMS supports all the permissions defined by CiviCRM and its extensions. If there are stale permissions, they should be deleted. This is useful during module upgrade when the newer module version has removed permission that were defined in the older version.
at line 241
static array
getModulePermissions($module)
Get the permissions defined in the hook_civicrm_permission implementation of the given module.
Note: At time of writing, this is only used with native extension-modules, so there's one, predictable calling convention (regardless of CMS).
at line 261
array
getAllModulePermissions(bool $descriptions = FALSE)
Get the permissions defined in the hook_civicrm_permission implementation in all enabled CiviCRM module extensions.