@Test public void testDeleteUserRole() throws Exception { when(authorizationRepository.getUserInfo(USER)).thenReturn(EventLog.SYSTEM_USER); defaultAuthorization.deleteUserRole(USER, TESTAPP, EventLog.SYSTEM_USER); verify(authorizationRepository).deleteUserRole(USER, TESTAPP); }
@Override public void deleteUserRole(UserInfo.Username userID, Application.Name applicationName, UserInfo admin) { authorizationRepository.deleteUserRole(userID, applicationName); UserInfo user = getUserInfo(userID); eventLog.postEvent(new AuthorizationChangeEvent(admin, applicationName, user, "", "")); }
DefaultAuthorization implements Authorization { @Override public void deleteUserRole(UserInfo.Username userID, Application.Name applicationName, UserInfo admin) { authorizationRepository.deleteUserRole(userID, applicationName); UserInfo user = getUserInfo(userID); eventLog.postEvent(new AuthorizationChangeEvent(admin, applicationName, user, "", "")); } }
DefaultAuthorization implements Authorization { @Override public void deleteUserRole(UserInfo.Username userID, Application.Name applicationName, UserInfo admin) { authorizationRepository.deleteUserRole(userID, applicationName); UserInfo user = getUserInfo(userID); eventLog.postEvent(new AuthorizationChangeEvent(admin, applicationName, user, "", "")); } @Inject  DefaultAuthorization(final AuthorizationRepository authorizationRepository, final Experiments experiments,
                                final EventLog eventLog); }
DefaultAuthorization implements Authorization { @Override public void deleteUserRole(UserInfo.Username userID, Application.Name applicationName, UserInfo admin) { authorizationRepository.deleteUserRole(userID, applicationName); UserInfo user = getUserInfo(userID); eventLog.postEvent(new AuthorizationChangeEvent(admin, applicationName, user, "", "")); } @Inject  DefaultAuthorization(final AuthorizationRepository authorizationRepository, final Experiments experiments,
                                final EventLog eventLog); @Override List<Permission> getPermissionsFromRole(Role role); @Override UserPermissionsList getUserPermissionsList(UserInfo.Username userID); @Override UserRoleList getApplicationUsers(Application.Name applicationName); @Override UserPermissions getUserPermissions(UserInfo.Username userID, Application.Name applicationName); @Override void deleteUserRole(UserInfo.Username userID, Application.Name applicationName, UserInfo admin); @Override void checkUserPermissions(UserInfo.Username userID, Application.Name applicationName, Permission permission); @Override UserInfo.Username getUser(String authHeader); @Override Map setUserRole(UserRole userRole, UserInfo admin); @Override UserRoleList getUserRoleList(UserInfo.Username userID); @Override void checkSuperAdmin(UserInfo.Username userID); @Override UserInfo getUserInfo(UserInfo.Username userID); @Override void assignUserToSuperAdminRole(final UserInfo candidateUserInfo, final UserInfo assigningUserInfo); @Override void removeUserFromSuperAdminRole(final UserInfo candidateUserInfo, final UserInfo assigningUserInfo); @Override List<UserRole> getSuperAdminRoleList(); }
DefaultAuthorization implements Authorization { @Override public void deleteUserRole(UserInfo.Username userID, Application.Name applicationName, UserInfo admin) { authorizationRepository.deleteUserRole(userID, applicationName); UserInfo user = getUserInfo(userID); eventLog.postEvent(new AuthorizationChangeEvent(admin, applicationName, user, "", "")); } @Inject  DefaultAuthorization(final AuthorizationRepository authorizationRepository, final Experiments experiments,
                                final EventLog eventLog); @Override List<Permission> getPermissionsFromRole(Role role); @Override UserPermissionsList getUserPermissionsList(UserInfo.Username userID); @Override UserRoleList getApplicationUsers(Application.Name applicationName); @Override UserPermissions getUserPermissions(UserInfo.Username userID, Application.Name applicationName); @Override void deleteUserRole(UserInfo.Username userID, Application.Name applicationName, UserInfo admin); @Override void checkUserPermissions(UserInfo.Username userID, Application.Name applicationName, Permission permission); @Override UserInfo.Username getUser(String authHeader); @Override Map setUserRole(UserRole userRole, UserInfo admin); @Override UserRoleList getUserRoleList(UserInfo.Username userID); @Override void checkSuperAdmin(UserInfo.Username userID); @Override UserInfo getUserInfo(UserInfo.Username userID); @Override void assignUserToSuperAdminRole(final UserInfo candidateUserInfo, final UserInfo assigningUserInfo); @Override void removeUserFromSuperAdminRole(final UserInfo candidateUserInfo, final UserInfo assigningUserInfo); @Override List<UserRole> getSuperAdminRoleList();  }