ItEr39S10CUAltaUsuario: list of roles associated to the user in the user edition page
Roles are just listed, they can't be added or deleted yet.
This commit is contained in:
parent
de5271a9e3
commit
741ff7ca29
4 changed files with 34 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ import java.util.List;
|
|||
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.users.entities.User;
|
||||
import org.navalplanner.business.users.entities.UserRole;
|
||||
|
||||
/**
|
||||
* Model for UI operations related to {@link User}
|
||||
|
|
@ -67,4 +68,11 @@ public interface IUserModel {
|
|||
*/
|
||||
void confirmSave() throws ValidationException;
|
||||
|
||||
/**
|
||||
* Retrieves the list of UserRoles associated with the current User.
|
||||
*
|
||||
* @return List of {@link UserRole} objects.
|
||||
*/
|
||||
List<UserRole> getRoles();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import java.util.List;
|
|||
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.users.entities.User;
|
||||
import org.navalplanner.business.users.entities.UserRole;
|
||||
import org.navalplanner.web.common.ConstraintChecker;
|
||||
import org.navalplanner.web.common.IMessagesForUser;
|
||||
import org.navalplanner.web.common.Level;
|
||||
|
|
@ -124,6 +125,10 @@ public class UserCRUDController extends GenericForwardComposer implements
|
|||
return userModel.getUser();
|
||||
}
|
||||
|
||||
public List<UserRole> getRoles() {
|
||||
return userModel.getRoles();
|
||||
}
|
||||
|
||||
private OnlyOneVisible getVisibility() {
|
||||
return (visibility == null) ? new OnlyOneVisible(createWindow,
|
||||
listWindow)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
package org.navalplanner.web.users;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
|
|
@ -108,4 +109,13 @@ public class UserModel implements IUserModel {
|
|||
each.getProfileName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserRole> getRoles() {
|
||||
List<UserRole> list = new ArrayList<UserRole>();
|
||||
if (user != null) {
|
||||
list.addAll(user.getRoles());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,17 @@
|
|||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<!-- Associated UserRoles -->
|
||||
<grid id="listing" model="@{controller.roles}">
|
||||
<columns sizable="true">
|
||||
<column label="${i18n:_('Role name')}" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row self="@{each='role'}" value="@{role}">
|
||||
<label value="@{role.displayName}" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</vbox>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue