ProcessMaker-BE "Role and Permission (Endpoints)"

- Se han implementado los siguientes Endpoints:
    GET    /api/1.0/{workspace}/role/{rol_uid}/permissions?filter={filter}&start={start}&limit={limit}
    GET    /api/1.0/{workspace}/role/{rol_uid}/available-permissions?filter={filter}&start={start}&limit={limit}
    POST   /api/1.0/{workspace}/role/{rol_uid}/permission
    DELETE /api/1.0/{workspace}/role/{rol_uid}/permission/{per_uid}
This commit is contained in:
Victor Saisa Lopez
2014-05-29 13:10:11 -04:00
parent 649f543773
commit 81d4700e7e
5 changed files with 514 additions and 3 deletions

View File

@@ -483,6 +483,27 @@ class Process
}
}
/**
* Verify if does not exist the Permission in table PERMISSIONS (Database RBAC)
*
* @param string $permissionUid Unique id of Permission
* @param string $fieldNameForException Field name for the exception
*
* return void Throw exception if does not exist the Permission in table PERMISSIONS
*/
public function throwExceptionIfNotExistsPermission($permissionUid, $fieldNameForException)
{
try {
$obj = \PermissionsPeer::retrieveByPK($permissionUid);
if (is_null($obj)) {
throw new \Exception(\G::LoadTranslation("ID_PERMISSION_DOES_NOT_EXIST", array($fieldNameForException, $permissionUid)));
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Update Process
*