@Test public void when_permission_revoked_the_resource_is_saved() throws Exception { service.revokePermission(resourceSecured, resourceSaver, Subject.APPLICATION); verify(resourceSaver).save(resourceSecured); }
public void revokePermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects) { revokePermission(resource, (resource1 -> alienDAO.save(resource1)), subjectType, subjects); }
ResourcePermissionService { public void revokePermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects) { revokePermission(resource, (resource1 -> alienDAO.save(resource1)), subjectType, subjects); } }
ResourcePermissionService { public void revokePermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects) { revokePermission(resource, (resource1 -> alienDAO.save(resource1)), subjectType, subjects); }  }
ResourcePermissionService { public void revokePermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects) { revokePermission(resource, (resource1 -> alienDAO.save(resource1)), subjectType, subjects); }  void grantPermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects); void grantPermission(ISecurityEnabledResource resource, IResourceSaver saver, Subject subjectType, String... subjects); void revokePermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects); void revokePermission(ISecurityEnabledResource resource, IResourceSaver saver, Subject subjectType, String... subjects); boolean anyHasPermission(ISecurityEnabledResource resource, Map<Subject, Set<String>> subjects); boolean allHavePermission(ISecurityEnabledResource resource, Map<Subject, Set<String>> subjects); List<User> getAuthorizedUsers(AbstractSecurityEnabledResource resource); List<Group> getAuthorizedGroups(AbstractSecurityEnabledResource resource); void revokeAuthorizedEnvironmentsAndEnvironmentTypesPerApplication(AbstractSecurityEnabledResource resource, String[] applicationsToDelete,
                                                                              String[] environmentsToDelete, String[] environmentTypesToDelete); void grantAuthorizedEnvironmentsAndEnvTypesPerApplication(AbstractSecurityEnabledResource resource, String[] applicationsToAdd, String[] environmentsToAdd,
                                                                     String[] environmentTypesToAdd); }
ResourcePermissionService { public void revokePermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects) { revokePermission(resource, (resource1 -> alienDAO.save(resource1)), subjectType, subjects); }  void grantPermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects); void grantPermission(ISecurityEnabledResource resource, IResourceSaver saver, Subject subjectType, String... subjects); void revokePermission(ISecurityEnabledResource resource, Subject subjectType, String... subjects); void revokePermission(ISecurityEnabledResource resource, IResourceSaver saver, Subject subjectType, String... subjects); boolean anyHasPermission(ISecurityEnabledResource resource, Map<Subject, Set<String>> subjects); boolean allHavePermission(ISecurityEnabledResource resource, Map<Subject, Set<String>> subjects); List<User> getAuthorizedUsers(AbstractSecurityEnabledResource resource); List<Group> getAuthorizedGroups(AbstractSecurityEnabledResource resource); void revokeAuthorizedEnvironmentsAndEnvironmentTypesPerApplication(AbstractSecurityEnabledResource resource, String[] applicationsToDelete,
                                                                              String[] environmentsToDelete, String[] environmentTypesToDelete); void grantAuthorizedEnvironmentsAndEnvTypesPerApplication(AbstractSecurityEnabledResource resource, String[] applicationsToAdd, String[] environmentsToAdd,
                                                                     String[] environmentTypesToAdd);  }