Skip to content

Commit

Permalink
REF - Use function to get componenent name from permission
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Feb 3, 2022
1 parent 97bd997 commit 5bee1fd
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions CRM/Core/BAO/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,7 @@ public static function checkPermission($permissions, $operator) {
foreach ($permissions as $key) {
$showDashlet = TRUE;

$componentName = NULL;
if (strpos($key, 'access') === 0) {
$componentName = trim(substr($key, 6));
if (!in_array($componentName, $allComponents)) {
$componentName = NULL;
}
}

// hack to handle case permissions
if (!$componentName
&& in_array($key, ['access my cases and activities', 'access all cases and activities'])
) {
$componentName = 'CiviCase';
}
$componentName = CRM_Core_Permission::getComponentName($key);

//hack to determine if it's a component related permission
if ($componentName) {
Expand Down

0 comments on commit 5bee1fd

Please sign in to comment.