@Test public void testCheckSuperAdminException() throws Exception { when(authorizationRepository.checkSuperAdminPermissions(USER, null)).thenReturn(null); thrown.expect(AuthenticationException.class); defaultAuthorization.checkSuperAdmin(USER); }
@Override public void checkSuperAdmin(UserInfo.Username userID) { if (authorizationRepository.checkSuperAdminPermissions(userID, null) == null) { throw new AuthenticationException("error, user " + userID + " is not a superadmin"); } }
DefaultAuthorization implements Authorization { @Override public void checkSuperAdmin(UserInfo.Username userID) { if (authorizationRepository.checkSuperAdminPermissions(userID, null) == null) { throw new AuthenticationException("error, user " + userID + " is not a superadmin"); } } }
DefaultAuthorization implements Authorization { @Override public void checkSuperAdmin(UserInfo.Username userID) { if (authorizationRepository.checkSuperAdminPermissions(userID, null) == null) { throw new AuthenticationException("error, user " + userID + " is not a superadmin"); } } @Inject  DefaultAuthorization(final AuthorizationRepository authorizationRepository, final Experiments experiments,
                                final EventLog eventLog); }
DefaultAuthorization implements Authorization { @Override public void checkSuperAdmin(UserInfo.Username userID) { if (authorizationRepository.checkSuperAdminPermissions(userID, null) == null) { throw new AuthenticationException("error, user " + userID + " is not a superadmin"); } } @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 checkSuperAdmin(UserInfo.Username userID) { if (authorizationRepository.checkSuperAdminPermissions(userID, null) == null) { throw new AuthenticationException("error, user " + userID + " is not a superadmin"); } } @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();  }