projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #24022 from colemanw/afformFrontend
[civicrm-core.git]
/
CRM
/
Core
/
Permission
/
Base.php
diff --git
a/CRM/Core/Permission/Base.php
b/CRM/Core/Permission/Base.php
index 0c7bf678a315607121959ca136bf4333d261108a..9b1ae5709bbcfa3486bfe22485ba5a401efe33ef 100644
(file)
--- a/
CRM/Core/Permission/Base.php
+++ b/
CRM/Core/Permission/Base.php
@@
-57,7
+57,7
@@
class CRM_Core_Permission_Base {
* a permission name
*/
public function translatePermission($perm, $nativePrefix, $map) {
* a permission name
*/
public function translatePermission($perm, $nativePrefix, $map) {
-
list ($civiPrefix, $name)
= CRM_Utils_String::parsePrefix(':', $perm, NULL);
+
[$civiPrefix, $name]
= CRM_Utils_String::parsePrefix(':', $perm, NULL);
switch ($civiPrefix) {
case $nativePrefix:
return $name;
switch ($civiPrefix) {
case $nativePrefix:
return $name;
@@
-75,10
+75,10
@@
class CRM_Core_Permission_Base {
}
/**
}
/**
- * Get the
current permission of this user
.
+ * Get the
maximum permission of the current user with respect to _any_ contact records
.
*
*
- * @return
string
- *
the permission of the user (edit or view or null
)
+ * @return
int|string|null
+ *
@see \CRM_Core_Permission::getPermission(
)
*/
public function getPermission() {
$this->group();
*/
public function getPermission() {
$this->group();
@@
-272,9
+272,12
@@
class CRM_Core_Permission_Base {
* The permission to check.
* @param int $userId
*
* The permission to check.
* @param int $userId
*
+ * @return bool;
+ *
*/
public function check($str, $userId = NULL) {
//no default behaviour
*/
public function check($str, $userId = NULL) {
//no default behaviour
+ return FALSE;
}
/**
}
/**
@@
-374,7
+377,7
@@
class CRM_Core_Permission_Base {
* Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions().
* @see CRM_Core_Permission::getCorePermissions
*/
* Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions().
* @see CRM_Core_Permission::getCorePermissions
*/
- public
static function getModulePermissions($module)
{
+ public
function getModulePermissions($module): array
{
$return_permissions = [];
$fn_name = "{$module}_civicrm_permission";
if (function_exists($fn_name)) {
$return_permissions = [];
$fn_name = "{$module}_civicrm_permission";
if (function_exists($fn_name)) {
@@
-394,8
+397,7
@@
class CRM_Core_Permission_Base {
* @return array
* Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions().
*/
* @return array
* Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions().
*/
- public function getAllModulePermissions($descriptions = FALSE) {
- // Passing in false here is to be deprecated.
+ public function getAllModulePermissions($descriptions = FALSE): array {
$permissions = [];
CRM_Utils_Hook::permission($permissions);
$permissions = [];
CRM_Utils_Hook::permission($permissions);
@@
-405,6
+407,7
@@
class CRM_Core_Permission_Base {
}
}
else {
}
}
else {
+ // Passing in false here is to be deprecated.
foreach ($permissions as $permission => $label) {
$permissions[$permission] = (is_array($label)) ? array_shift($label) : $label;
}
foreach ($permissions as $permission => $label) {
$permissions[$permission] = (is_array($label)) ? array_shift($label) : $label;
}