CodeExplorer makePermissions example
return $permissions;
} private function isCrudPrivilege(string
$privilege): bool
{ return substr_count($privilege, ':'
) === 1;
} private function makeCategorizedPermissions(array
$privilegesDelta): array
{ $permissions =
$this->
makePermissions($privilegesDelta);
$permissionCollection =
new PermissionCollection();
foreach ($permissions as $permission) { $permissionCollection->
add(PermissionStruct::
fromArray([ 'entity' =>
$permission['entity'
],
'operation' =>
$permission['operation'
],
]));
} return $permissionCollection->
getCategorizedPermissions();
}