WorkflowManagerBean implements IWorkflowManagerLocal { @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override public void removeACLFromWorkflow(String pWorkspaceId, String workflowModelId) throws UserNotFoundException, UserNotActiveException, WorkspaceNotFoundException, WorkflowModelNotFoundException, AccessRightException, WorkspaceNotEnabledException { User user = userManager.checkWorkspaceReadAccess(pWorkspaceId); WorkflowModelKey workflowModelKey = new WorkflowModelKey(pWorkspaceId, workflowModelId); WorkflowModel workflowModel = workflowModelDAO.loadWorkflowModel(workflowModelKey); checkWorkflowWriteAccess(workflowModel, user); ACL acl = workflowModel.getAcl(); if (acl != null) { aclDAO.removeACLEntries(acl); workflowModel.setAcl(null); } }  @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void deleteWorkflowModel(WorkflowModelKey pKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override WorkflowModel createWorkflowModel(String pWorkspaceId, String pId, String pFinalLifeCycleState, ActivityModel[] pActivityModels); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override WorkflowModel updateWorkflowModel(WorkflowModelKey workflowModelKey, String pFinalLifeCycleState, ActivityModel[] pActivityModels); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override WorkflowModel[] getWorkflowModels(String pWorkspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override WorkflowModel getWorkflowModel(WorkflowModelKey pKey); @Override @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) Role[] getRoles(String pWorkspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Role[] getRolesInUse(String pWorkspaceId); @Override @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) Role createRole(String roleName, String workspaceId, List<String> userLogins, List<String> userGroupIds); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Role updateRole(RoleKey roleKey, List<String> userLogins, List<String> userGroupIds); @Override @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) void deleteRole(RoleKey roleKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void removeUserFromAllRoleMappings(User pUser); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void removeUserGroupFromAllRoleMappings(UserGroup pUserGroup); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void removeACLFromWorkflow(String pWorkspaceId, String workflowModelId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override WorkflowModel updateACLForWorkflow(String pWorkspaceId, String workflowModelId, Map<String, String> userEntries, Map<String, String> groupEntries); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override WorkspaceWorkflow instantiateWorkflow(String workspaceId, String id, String workflowModelId, Map<String, Collection<String>> userRoleMapping, Map<String, Collection<String>> groupRoleMapping); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Workflow getWorkflow(String workspaceId, int workflowId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override WorkspaceWorkflow getWorkspaceWorkflow(String workspaceId, String workspaceWorkflowId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Workflow[] getWorkflowAbortedWorkflowList(String workspaceId, int workflowId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void approveTaskOnWorkspaceWorkflow(String workspaceId, TaskKey taskKey, String comment, String signature); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void rejectTaskOnWorkspaceWorkflow(String workspaceId, TaskKey taskKey, String comment, String signature); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override WorkspaceWorkflow[] getWorkspaceWorkflowList(String workspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void deleteWorkspaceWorkflow(String workspaceId, String workspaceWorkflowId);  }
@Test(expected = AccessRightException.class) public void testRemoveACLFromWorkflow() throws Exception { WorkflowModel workflowModel = new WorkflowModel(workspace, WorkflowUtil.WORKSPACE_ID, user, ""); ACL acl = new ACL(); acl.addEntry(user, ACLPermission.READ_ONLY); workflowModel.setAcl(acl); Mockito.when(userManager.checkWorkspaceReadAccess(WorkflowUtil.WORKSPACE_ID)).thenReturn(user); Mockito.when(workflowModelDAO.loadWorkflowModel(workflowModelKey)).thenReturn(workflowModel); workflowManagerBean.removeACLFromWorkflow(WorkflowUtil.WORKSPACE_ID, WorkflowUtil.WORKFLOW_MODEL_ID); }