本文整理汇总了PHP中RBAC::loadUserRolePermission方法的典型用法代码示例。如果您正苦于以下问题:PHP RBAC::loadUserRolePermission方法的具体用法?PHP RBAC::loadUserRolePermission怎么用?PHP RBAC::loadUserRolePermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RBAC
的用法示例。
在下文中一共展示了RBAC::loadUserRolePermission方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* Update User
*
* @param string $userUid Unique id of User
* @param array $arrayData Data
* @param string $userUidLogged Unique id of User logged
*
* return array Return data of the User updated
*/
public function update($userUid, array $arrayData, $userUidLogged)
{
try {
\G::LoadSystem("rbac");
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$validator = new \ProcessMaker\BusinessModel\Validator();
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
//Set data
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
$arrayDataBackup = $arrayData;
//Verify data
$this->throwExceptionIfNotExistsUser($userUid, $this->arrayFieldNameForException["usrUid"]);
$this->throwExceptionIfDataIsInvalid($userUid, $arrayData);
//Permission Admin
$countPermission = 0;
$permission = $this->loadUserRolePermission("PROCESSMAKER", $userUidLogged);
foreach ($permission as $key => $value) {
if ($value["PER_CODE"] == "PM_USERS") {
$countPermission = $countPermission + 1;
}
}
if ($countPermission != 1) {
throw new \Exception(\G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($userUidLogged)));
}
//Update
$cnn = \Propel::getConnection("workflow");
try {
$rbac = new \RBAC();
//.........这里部分代码省略.........