public Void execute(CommandContext commandContext) { AuthorizationManager authorizationManager = spyOnSession(commandContext, AuthorizationManager.class); TaskQueryImpl taskQuery = (TaskQueryImpl) spy(processEngine.getTaskService().createTaskQuery()); AuthorizationCheck authCheck = spy(new AuthorizationCheck()); when(taskQuery.getAuthCheck()).thenReturn(authCheck); taskQuery.list(); verify(authorizationManager, atLeastOnce()).filterAuthenticatedGroupIds(eq((List<String>) null)); verify(authCheck).setAuthGroupIds(eq(Collections.<String>emptyList())); return null; } });
public Void execute(CommandContext commandContext) { AuthorizationManager authorizationManager = spyOnSession(commandContext, AuthorizationManager.class); TaskQueryImpl taskQuery = (TaskQueryImpl) spy(processEngine.getTaskService().createTaskQuery()); AuthorizationCheck authCheck = spy(new AuthorizationCheck()); when(taskQuery.getAuthCheck()).thenReturn(authCheck); taskQuery.list(); verify(authorizationManager, atLeastOnce()).filterAuthenticatedGroupIds(eq(testGroupIds)); verify(authCheck).setAuthGroupIds(eq(testGroupIds.subList(0, 1))); return null; } });
public Void execute(CommandContext commandContext) { AuthorizationManager authorizationManager = spyOnSession(commandContext, AuthorizationManager.class); TaskQueryImpl taskQuery = (TaskQueryImpl) spy(processEngine.getTaskService().createTaskQuery()); AuthorizationCheck authCheck = spy(new AuthorizationCheck()); when(taskQuery.getAuthCheck()).thenReturn(authCheck); taskQuery.list(); verify(authorizationManager, atLeastOnce()).filterAuthenticatedGroupIds(eq(testGroupIds)); verify(authCheck).setAuthGroupIds(eq(Collections.<String>emptyList())); return null; } });
public Void execute(CommandContext commandContext) { AuthorizationManager authorizationManager = spyOnSession(commandContext, AuthorizationManager.class); TaskQueryImpl taskQuery = (TaskQueryImpl) spy(processEngine.getTaskService().createTaskQuery()); AuthorizationCheck authCheck = spy(new AuthorizationCheck()); when(taskQuery.getAuthCheck()).thenReturn(authCheck); taskQuery.list(); verify(authorizationManager, atLeastOnce()).filterAuthenticatedGroupIds(eq(testGroupIds)); verify(authCheck, atLeastOnce()).setAuthGroupIds((List<String>) argThat(containsInAnyOrder(testGroupIds.toArray()))); return null; } });
public void enableQueryAuthCheck(AuthorizationCheck authCheck) { List<String> authGroupIds = authCheck.getAuthGroupIds(); String authUserId = authCheck.getAuthUserId(); authCheck.setAuthorizationCheckEnabled(true); authCheck.setAuthGroupIds(filterAuthenticatedGroupIds(authGroupIds)); authCheck.setRevokeAuthorizationCheckEnabled(isRevokeAuthCheckEnabled(authUserId, authGroupIds)); }
public void configureQuery(ListQueryParameterObject query) { AuthorizationCheck authCheck = query.getAuthCheck(); authCheck.getPermissionChecks().clear(); if(isAuthCheckExecuted()) { Authentication currentAuthentication = getCurrentAuthentication(); authCheck.setAuthUserId(currentAuthentication.getUserId()); authCheck.setAuthGroupIds(currentAuthentication.getGroupIds()); enableQueryAuthCheck(authCheck); } else { authCheck.setAuthorizationCheckEnabled(false); authCheck.setAuthUserId(null); authCheck.setAuthGroupIds(null); } }
public void enableQueryAuthCheck(AuthorizationCheck authCheck) { List<String> authGroupIds = authCheck.getAuthGroupIds(); String authUserId = authCheck.getAuthUserId(); authCheck.setAuthorizationCheckEnabled(true); authCheck.setAuthGroupIds(filterAuthenticatedGroupIds(authGroupIds)); authCheck.setRevokeAuthorizationCheckEnabled(isRevokeAuthCheckEnabled(authUserId, authGroupIds)); }
public void configureQuery(ListQueryParameterObject query) { AuthorizationCheck authCheck = query.getAuthCheck(); authCheck.getPermissionChecks().clear(); if(isAuthCheckExecuted()) { Authentication currentAuthentication = getCurrentAuthentication(); authCheck.setAuthUserId(currentAuthentication.getUserId()); authCheck.setAuthGroupIds(currentAuthentication.getGroupIds()); enableQueryAuthCheck(authCheck); } else { authCheck.setAuthorizationCheckEnabled(false); authCheck.setAuthUserId(null); authCheck.setAuthGroupIds(null); } }
public Void execute(CommandContext commandContext) { AuthorizationManager authorizationManager = spyOnSession(commandContext, AuthorizationManager.class); TaskQueryImpl taskQuery = (TaskQueryImpl) spy(processEngine.getTaskService().createTaskQuery()); AuthorizationCheck authCheck = spy(new AuthorizationCheck()); when(taskQuery.getAuthCheck()).thenReturn(authCheck); taskQuery.list(); verify(authorizationManager, atLeastOnce()).filterAuthenticatedGroupIds(eq(testGroupIds)); verify(authCheck).setAuthGroupIds(eq(testGroupIds.subList(0, 1))); return null; } });
public Void execute(CommandContext commandContext) { AuthorizationManager authorizationManager = spyOnSession(commandContext, AuthorizationManager.class); TaskQueryImpl taskQuery = (TaskQueryImpl) spy(processEngine.getTaskService().createTaskQuery()); AuthorizationCheck authCheck = spy(new AuthorizationCheck()); when(taskQuery.getAuthCheck()).thenReturn(authCheck); taskQuery.list(); verify(authorizationManager, atLeastOnce()).filterAuthenticatedGroupIds(eq((List<String>) null)); verify(authCheck).setAuthGroupIds(eq(Collections.<String>emptyList())); return null; } });
public Void execute(CommandContext commandContext) { AuthorizationManager authorizationManager = spyOnSession(commandContext, AuthorizationManager.class); TaskQueryImpl taskQuery = (TaskQueryImpl) spy(processEngine.getTaskService().createTaskQuery()); AuthorizationCheck authCheck = spy(new AuthorizationCheck()); when(taskQuery.getAuthCheck()).thenReturn(authCheck); taskQuery.list(); verify(authorizationManager, atLeastOnce()).filterAuthenticatedGroupIds(eq(testGroupIds)); verify(authCheck).setAuthGroupIds(eq(Collections.<String>emptyList())); return null; } });
public Void execute(CommandContext commandContext) { AuthorizationManager authorizationManager = spyOnSession(commandContext, AuthorizationManager.class); TaskQueryImpl taskQuery = (TaskQueryImpl) spy(processEngine.getTaskService().createTaskQuery()); AuthorizationCheck authCheck = spy(new AuthorizationCheck()); when(taskQuery.getAuthCheck()).thenReturn(authCheck); taskQuery.list(); verify(authorizationManager, atLeastOnce()).filterAuthenticatedGroupIds(eq(testGroupIds)); verify(authCheck, atLeastOnce()).setAuthGroupIds((List<String>) argThat(containsInAnyOrder(testGroupIds.toArray()))); return null; } });
public void enableQueryAuthCheck(AuthorizationCheck authCheck) { List<String> authGroupIds = authCheck.getAuthGroupIds(); String authUserId = authCheck.getAuthUserId(); authCheck.setAuthorizationCheckEnabled(true); authCheck.setAuthGroupIds(filterAuthenticatedGroupIds(authGroupIds)); authCheck.setRevokeAuthorizationCheckEnabled(isRevokeAuthCheckEnabled(authUserId, authGroupIds)); }
public void configureQuery(ListQueryParameterObject query) { AuthorizationCheck authCheck = query.getAuthCheck(); authCheck.getPermissionChecks().clear(); if(isAuthCheckExecuted()) { Authentication currentAuthentication = getCurrentAuthentication(); authCheck.setAuthUserId(currentAuthentication.getUserId()); authCheck.setAuthGroupIds(currentAuthentication.getGroupIds()); enableQueryAuthCheck(authCheck); } else { authCheck.setAuthorizationCheckEnabled(false); authCheck.setAuthUserId(null); authCheck.setAuthGroupIds(null); } }