public void deleteAuthorization() { Authorization dbAuthorization = getDbAuthorization(); authorizationService.deleteAuthorization(dbAuthorization.getId()); }
public void tearDown(AuthorizationService authorizationService) { Set<String> activeAuthorizations = new HashSet<String>(); for (Authorization activeAuthorization : authorizationService.createAuthorizationQuery().list()) { activeAuthorizations.add(activeAuthorization.getId()); } for (Authorization createdAuthorization : createdAuthorizations) { if (activeAuthorizations.contains(createdAuthorization.getId())) { authorizationService.deleteAuthorization(createdAuthorization.getId()); } } }
public static Authorization createMockGlobalAuthorization() { Authorization mockAuthorization = mock(Authorization.class); when(mockAuthorization.getId()).thenReturn(EXAMPLE_AUTHORIZATION_ID); when(mockAuthorization.getAuthorizationType()).thenReturn(Authorization.AUTH_TYPE_GLOBAL); when(mockAuthorization.getUserId()).thenReturn(Authorization.ANY); when(mockAuthorization.getResourceType()).thenReturn(EXAMPLE_RESOURCE_TYPE_ID); when(mockAuthorization.getResourceId()).thenReturn(EXAMPLE_RESOURCE_ID); when(mockAuthorization.getPermissions(Permissions.values())).thenReturn(EXAMPLE_GRANT_PERMISSION_VALUES); return mockAuthorization; }
public static Authorization createMockGrantAuthorization() { Authorization mockAuthorization = mock(Authorization.class); when(mockAuthorization.getId()).thenReturn(EXAMPLE_AUTHORIZATION_ID); when(mockAuthorization.getAuthorizationType()).thenReturn(Authorization.AUTH_TYPE_GRANT); when(mockAuthorization.getUserId()).thenReturn(EXAMPLE_USER_ID); when(mockAuthorization.getResourceType()).thenReturn(EXAMPLE_RESOURCE_TYPE_ID); when(mockAuthorization.getResourceId()).thenReturn(EXAMPLE_RESOURCE_ID); when(mockAuthorization.getPermissions(Permissions.values())).thenReturn(EXAMPLE_GRANT_PERMISSION_VALUES); return mockAuthorization; }
protected void deleteManagedAuthorizations() { for (Authorization authorization : authorizations) { engineRule.getAuthorizationService().deleteAuthorization(authorization.getId()); } }
public AuthorizationDto createAuthorization(UriInfo context, AuthorizationCreateDto dto) { final AuthorizationService authorizationService = processEngine.getAuthorizationService(); Authorization newAuthorization = authorizationService.createNewAuthorization(dto.getType()); AuthorizationCreateDto.update(dto, newAuthorization); newAuthorization = authorizationService.saveAuthorization(newAuthorization); return getAuthorization(newAuthorization.getId()).getAuthorization(context); }
protected void cleanupAfterTest() { for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } } }
protected void cleanupAfterTest() { for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } }
@After public void tearDown() { for (Authorization authorization : authorizations) { engineRule.getAuthorizationService().deleteAuthorization(authorization.getId()); } authRule.deleteUsersAndGroups(); }
protected void tearDown() throws Exception { List<Authorization> list = authorizationService.createAuthorizationQuery().list(); for (Authorization authorization : list) { authorizationService.deleteAuthorization(authorization.getId()); } super.tearDown(); }
protected void deleteAuthorizations() { AuthorizationService authorizationService = engineRule.getAuthorizationService(); for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } }
protected void tearDown() throws Exception { processEngineConfiguration.setAuthorizationEnabled(false); List<Authorization> jonnysAuths = authorizationService.createAuthorizationQuery().userIdIn("jonny").list(); for (Authorization authorization : jonnysAuths) { authorizationService.deleteAuthorization(authorization.getId()); } super.tearDown(); }
public static AuthorizationDto fromAuthorization(Authorization dbAuthorization) { AuthorizationDto authorizationDto = new AuthorizationDto(); authorizationDto.setId(dbAuthorization.getId()); authorizationDto.setType(dbAuthorization.getAuthorizationType()); Permission[] dbPermissions = getPermissions(dbAuthorization); authorizationDto.setPermissions(PermissionConverter.getNamesForPermissions(dbAuthorization, dbPermissions)); authorizationDto.setUserId(dbAuthorization.getUserId()); authorizationDto.setGroupId(dbAuthorization.getGroupId()); authorizationDto.setResourceType(dbAuthorization.getResourceType()); authorizationDto.setResourceId(dbAuthorization.getResourceId()); return authorizationDto; }
protected void cleanupAfterTest() { for (User user : identityService.createUserQuery().list()) { identityService.deleteUser(user.getId()); } for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } }
protected void cleanupAfterTest() { for (User user : identityService.createUserQuery().list()) { identityService.deleteUser(user.getId()); } for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } } }
public static AuthorizationDto fromAuthorization(Authorization dbAuthorization) { AuthorizationDto authorizationDto = new AuthorizationDto(); authorizationDto.setId(dbAuthorization.getId()); authorizationDto.setType(dbAuthorization.getAuthorizationType()); Permission[] dbPermissions = getPermissions(dbAuthorization); authorizationDto.setPermissions(PermissionConverter.getNamesForPermissions(dbAuthorization, dbPermissions)); authorizationDto.setUserId(dbAuthorization.getUserId()); authorizationDto.setGroupId(dbAuthorization.getGroupId()); authorizationDto.setResourceType(dbAuthorization.getResourceType()); authorizationDto.setResourceId(dbAuthorization.getResourceId()); return authorizationDto; }
protected void cleanupAfterTest() { for (Group group : identityService.createGroupQuery().list()) { identityService.deleteGroup(group.getId()); } for (User user : identityService.createUserQuery().list()) { identityService.deleteUser(user.getId()); } for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } }
protected void cleanupAfterTest() { for (Group group : identityService.createGroupQuery().list()) { identityService.deleteGroup(group.getId()); } for (User user : identityService.createUserQuery().list()) { identityService.deleteUser(user.getId()); } for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } }
@After public void cleanUp() { for (User user : identityService.createUserQuery().list()) { identityService.deleteUser(user.getId()); } for (Group group : identityService.createGroupQuery().list()) { identityService.deleteGroup(group.getId()); } for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } ClockUtil.reset(); }
@After public void cleanUp() { for (User user : identityService.createUserQuery().list()) { identityService.deleteUser(user.getId()); } for (Group group : identityService.createGroupQuery().list()) { identityService.deleteGroup(group.getId()); } for (Authorization authorization : authorizationService.createAuthorizationQuery().list()) { authorizationService.deleteAuthorization(authorization.getId()); } ClockUtil.reset(); identityService.clearAuthentication(); }