Ask questions about installing and configuring ProcessMaker 3
#815197
Dear Community

I need to prevent users with a specific role from un-pausing a case, is there a way to prevent this as an Out-Of-The-Box solution? I want to prevent this even if the user is assigned to this task, I don't want user to un-pause a case before it is due.

Your help is much appreciated,

Mostafa
#815201
You have to change the source code to prevent this.
In workflow/engine/classes/class.case.php:3997, change from:
Code: Select all
    public function unpauseCase($sApplicationUID, $iDelegation, $sUserUID)
    {
        //Verify status of the case
To:
Code: Select all
    public function unpauseCase($sApplicationUID, $iDelegation, $sUserUID)
    {        
        //if the user has a specified role, then don't allow unpausing cases:
        G::LoadClass("users");
        $u = new Users();
        $aUserInfo = $u->Load($sUserUID);
      
        //change the role code
        if (!empty($aUserInfo) and $aUserInfo['USR_ROLE'] == 'PROCESSMAKER_ADMIN') {
            return false;
        }

         //Verify status of the case
This won't tell the user why unpausing the case doesn't work, but the case won't be unpaused.

If you want to inform the user, then you will have to edit the callbackUnpauseCase() function in workflow/engine/templates/cases/casesList.js:430 to check if false is returned and display an error message to the user. Then, edit the workflow/engine/methods/cases/cases_Ajax.php:411 to pass up what is returned by Cases::unpauseCase() so that it can be seen by callbackUnpauseCase(). If all of this is beyond you, then hire a programmer to help you.
#823199
viprit wrote:I need to prevent users with a specific role from un-pausing a case, is there a way to prevent this as an Out-Of-The-Box solution? I want to prevent this even if the user is assigned to this task, I don't want user to un-pause a case before it is due.
Changing the source code as shown above is the only way to do it.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]