PM-3376 "REST endpoint PUT users, groups,..." SOLVED
> Code Isuue: 0018011: Security hole:REST endpoints for users,groups,departments & roles do not check if logged-in user has PM_USERS permission in role > Solution: Se agrega validacion en el siguiente Endpoint cuando se utiliza el servicio REST, el mismo mostrara un mensaje indicando que el usuario no esta autorizado para realizar la accion.
This commit is contained in:
@@ -11,6 +11,26 @@ use \Luracast\Restler\RestException;
|
||||
*/
|
||||
class User extends Api
|
||||
{
|
||||
/**
|
||||
* Constructor of the class
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
try {
|
||||
$user = new \ProcessMaker\BusinessModel\User();
|
||||
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
if (!$user->checkPermission($usrUid, "PM_USERS")) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION", array($usrUid)));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET
|
||||
* @param string $filter
|
||||
|
||||
Reference in New Issue
Block a user