@Test public void testGetPermissionsFromRole() throws Exception { List<Role> roleList = new ArrayList<>(); roleList.add(Role.ADMIN); roleList.add(Role.READONLY); roleList.add(Role.READWRITE); roleList.add(Role.SUPERADMIN); for (Role role : roleList) { List<Permission> permissionList = defaultAuthorization.getPermissionsFromRole(role); assertThat(permissionList, equalTo(role.getRolePermissions())); } }
@Override public List<Permission> getPermissionsFromRole(Role role) { return role.getRolePermissions(); }
DefaultAuthorization implements Authorization { @Override public List<Permission> getPermissionsFromRole(Role role) { return role.getRolePermissions(); } }
DefaultAuthorization implements Authorization { @Override public List<Permission> getPermissionsFromRole(Role role) { return role.getRolePermissions(); } @Inject  DefaultAuthorization(final AuthorizationRepository authorizationRepository, final Experiments experiments,
                                final EventLog eventLog); }
DefaultAuthorization implements Authorization { @Override public List<Permission> getPermissionsFromRole(Role role) { return role.getRolePermissions(); } @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 List<Permission> getPermissionsFromRole(Role role) { return role.getRolePermissions(); } @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();  }