PR observations

|:wq
This commit is contained in:
Paula Quispe
2017-05-23 16:12:45 -04:00
parent 2b2d27ff0a
commit 88da56ea9a
2 changed files with 16 additions and 12 deletions

View File

@@ -78,6 +78,7 @@ class RBAC
'users_Ajax.php' => array(
'availableUsers' => array('PM_FACTORY'),
'assign' => array('PM_FACTORY'),
'changeView' => array(),
'ofToAssign' => array('PM_FACTORY'),
'usersGroup' => array('PM_FACTORY'),
'canDeleteUser' => array('PM_USERS'),
@@ -91,6 +92,7 @@ class RBAC
'loadAuthSourceByUID' => array('PM_USERS'),
'updateAuthServices' => array('PM_USERS'),
'usersList' => array('PM_USERS'),
'updatePageSize' => array(),
'summaryUserData' => array('PM_USERS'),
'verifyIfUserAssignedAsSupervisor' => array('PM_USERS'),
)
@@ -1475,8 +1477,9 @@ class RBAC
*/
public function allows($file, $action)
{
$access = true;
$permissions = isset($this->authorizedActions[$file][$action]) ? $this->authorizedActions[$file][$action] : array();
$access = false;
if (isset($this->authorizedActions[$file][$action])) {
$permissions = $this->authorizedActions[$file][$action];
$totalPermissions = count($permissions);
$countAccess = 0;
foreach ($permissions as $key => $value) {
@@ -1485,8 +1488,9 @@ class RBAC
}
}
//Check if the user has all permissions that needed
if ($countAccess !== $totalPermissions) {
$access = false;
if ($countAccess == $totalPermissions) {
$access = true;
}
}
if (!$access) {