HOR-4754
This commit is contained in:
@@ -1323,6 +1323,33 @@ class RBAC
|
||||
return $this->rolesObj->loadById($rolUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Role code
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $role
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRoleCodeValid($role)
|
||||
{
|
||||
$roleCode = '';
|
||||
|
||||
if (!empty($role)) {
|
||||
if ($this->verifyByCode($role)) {
|
||||
//If is a valid ROL_CODE
|
||||
$roleCode = $role;
|
||||
} else {
|
||||
//We will to check by ROL_UID
|
||||
$roleInfo = $this->loadById($role);
|
||||
$roleCode = !empty($roleInfo['ROL_CODE']) ? $roleInfo['ROL_CODE'] : '';
|
||||
}
|
||||
}
|
||||
|
||||
return $roleCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* this function gets the user's roles
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user