+
+ // TODO: following has been disabled because it causes NPE after a
+ // login/logout on RAP
+ // Image titleIcon = user.getType() == Role.GROUP ?
+ // SecurityAdminImages.ICON_GROUP
+ // : SecurityAdminImages.ICON_USER;
+ // setTitleImage(titleIcon);
+ }
+
+ /**
+ * returns the list of all authorisation for the given user or of the
+ * current displayed user if parameter is null
+ */
+ protected List<User> getFlatGroups(User aUser) {
+ Authorization currAuth;
+ if (aUser == null)
+ currAuth = userAdmin.getAuthorization(this.user);
+ else
+ currAuth = userAdmin.getAuthorization(aUser);
+
+ String[] roles = currAuth.getRoles();
+
+ List<User> groups = new ArrayList<User>();
+ for (String roleStr : roles) {
+ User currRole = (User) userAdmin.getRole(roleStr);
+ if (!groups.contains(currRole))
+ groups.add(currRole);
+ }
+ return groups;