class AcmObjectLockAPIController {

    @PreAuthorize("hasPermission(#objectId, #objectType, 'lock')")
    @RequestMapping(value = { "/api/v1/plugin/{objectType}/{objectId}/lock",
            "/api/latest/plugin/{objectType}/{objectId}/lock" }, method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public AcmObjectLock lockObject(@PathVariable(value = "objectType") String objectType, @PathVariable(value = "objectId") Long objectId,
            @RequestParam(value = "lockType", required = false, defaultValue = "OBJECT_LOCK") String lockType,
            @RequestParam(value = "lockInDB", required = false, defaultValue = "true") boolean lockInDB, Authentication authentication)
            throws MuleException, IOException, AcmObjectLockException

    {
        return objectLockingManager.acquireObjectLock(objectId, objectType, lockType, null, true, authentication.getName());
    }

}