Merged in cochalo/processmaker (pull request #79)
Adicion la funcionalidad DELETE en PROCESS PERMISSIONS
This commit is contained in:
@@ -13,8 +13,10 @@ use \ObjectPermissionPeer;
|
||||
class ProcessPermissions
|
||||
{
|
||||
/**
|
||||
* Get list for ProcessPermissions
|
||||
* Get list for Process Permissions
|
||||
*
|
||||
* @var string $sProcessUID. Uid for Process
|
||||
* @var string $sPermissionUid. Uid for Process Permission
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
@@ -163,5 +165,28 @@ class ProcessPermissions
|
||||
}
|
||||
return $aObjectsPermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Process Permission
|
||||
*
|
||||
* @var string $sPermissionUid. Uid for Process Permission
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteProcessPermission($sPermissionUid)
|
||||
{
|
||||
try {
|
||||
require_once 'classes/model/ObjectPermission.php';
|
||||
$oOP = new \ObjectPermission();
|
||||
$oOP = ObjectPermissionPeer::retrieveByPK( $sPermissionUid );
|
||||
$oOP->delete();
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,5 +58,29 @@ class ProcessPermissions extends Api
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $projectUid {@min 1} {@max 32}
|
||||
* @param string $objectPermissionUid {@min 1} {@max 32}
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @url DELETE /:projectUid/process-permission/:objectPermissionUid
|
||||
*/
|
||||
public function doDeleteProcessPermission($projectUid, $objectPermissionUid)
|
||||
{
|
||||
try {
|
||||
$processPermissions = new \BusinessModel\ProcessPermissions();
|
||||
$response = $processPermissions->deleteProcessPermission($objectPermissionUid, $projectUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user