Fix UserAccounts list page so it encodes the role URIs properly when filtering. Only show non-public roles for selections.
This commit is contained in:
parent
5051c56f7a
commit
c18e14a106
6 changed files with 14 additions and 10 deletions
|
@ -3,7 +3,6 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.controller.accounts;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
@ -54,11 +53,16 @@ public abstract class UserAccountsPage extends AbstractPageHandler {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a list of all known PermissionSets.
|
||||
* Create a list of all known non-public PermissionSets.
|
||||
*/
|
||||
protected List<PermissionSet> buildRolesList() {
|
||||
protected List<PermissionSet> buildListOfSelectableRoles() {
|
||||
List<PermissionSet> list = new ArrayList<PermissionSet>();
|
||||
list.addAll(userAccountsDao.getAllPermissionSets());
|
||||
for (PermissionSet ps: userAccountsDao.getAllPermissionSets()) {
|
||||
if (!ps.isForPublic()) {
|
||||
list.add(ps);
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(list, new Comparator<PermissionSet>() {
|
||||
@Override
|
||||
public int compare(PermissionSet ps1, PermissionSet ps2) {
|
||||
|
|
|
@ -194,7 +194,7 @@ public class UserAccountsAddPage extends UserAccountsPage {
|
|||
body.put(PARAMETER_FIRST_NAME, firstName);
|
||||
body.put(PARAMETER_LAST_NAME, lastName);
|
||||
body.put("selectedRole", selectedRoleUri);
|
||||
body.put("roles", buildRolesList());
|
||||
body.put("roles", buildListOfSelectableRoles());
|
||||
body.put("profileTypes", buildProfileTypesList());
|
||||
body.put(PARAMETER_NEW_PROFILE_CLASS_URI, newProfileClassUri);
|
||||
body.put("formUrls", buildUrlsMap());
|
||||
|
|
|
@ -235,7 +235,7 @@ public class UserAccountsEditPage extends UserAccountsPage {
|
|||
}
|
||||
|
||||
if (!isRootUser()) {
|
||||
body.put("roles", buildRolesList());
|
||||
body.put("roles", buildListOfSelectableRoles());
|
||||
}
|
||||
|
||||
body.put("profileTypes", buildProfileTypesList());
|
||||
|
|
|
@ -115,7 +115,7 @@ public class UserAccountsListPage extends UserAccountsPage {
|
|||
body.put("page", buildPageMap(selection));
|
||||
|
||||
body.put("formUrls", buildUrlsMap());
|
||||
body.put("roles", buildRolesList());
|
||||
body.put("roles", buildListOfSelectableRoles());
|
||||
|
||||
body.put("messages", buildMessagesMap());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue