mirror of https://github.com/apache/archiva.git
fixed up the user manglement page to work with the multiple entry points to it, as well as the granting of roles from the forms
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@443254 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3ca919b9f3
commit
997a1988c0
|
@ -73,26 +73,33 @@ public class UserManagementAction
|
|||
public void prepare()
|
||||
throws Exception
|
||||
{
|
||||
|
||||
if ( username != null )
|
||||
if ( username == null || "".equals( username ) )
|
||||
{
|
||||
user = userManager.findUser( (String) session.get( "MANAGED_USERNAME" ) );
|
||||
username = user.getUsername();
|
||||
}
|
||||
else
|
||||
{
|
||||
user = userManager.findUser( username );
|
||||
|
||||
principal = user.getPrincipal().toString();
|
||||
fullName = user.getFullName();
|
||||
email = user.getEmail();
|
||||
|
||||
if ( principal != null && rbacManager.userAssignmentExists( principal ) )
|
||||
{
|
||||
assignedRoles = new ArrayList( rbacManager.getAssignedRoles( principal ) );
|
||||
availableRoles = new ArrayList( rbacManager.getUnassignedRoles( principal ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
assignedRoles = new ArrayList();
|
||||
availableRoles = rbacManager.getAllAssignableRoles();
|
||||
}
|
||||
}
|
||||
|
||||
session.put( "MANAGED_USERNAME", username );
|
||||
|
||||
principal = user.getPrincipal().toString();
|
||||
fullName = user.getFullName();
|
||||
email = user.getEmail();
|
||||
|
||||
if ( principal != null && rbacManager.userAssignmentExists( principal ) )
|
||||
{
|
||||
assignedRoles = new ArrayList( rbacManager.getAssignedRoles( principal ) );
|
||||
availableRoles = new ArrayList( rbacManager.getUnassignedRoles( principal ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
assignedRoles = new ArrayList();
|
||||
availableRoles = rbacManager.getAllAssignableRoles();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,13 +107,14 @@ public class UserManagementAction
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public String input()
|
||||
public String findUser()
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( username != null )
|
||||
{
|
||||
user = userManager.findUser( username );
|
||||
session.put( "MANAGED_USERNAME", username );
|
||||
return SUCCESS;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -255,29 +255,29 @@
|
|||
|
||||
<action name="user" class="userManagement">
|
||||
<result name="success">/WEB-INF/jsp/admin/user.jsp</result>
|
||||
<result name="input" type="chain">userManagement</result>
|
||||
<result name="input" type="redirect-action">userManagement</result>
|
||||
<interceptor-ref name="configuredPrepareParamsStack"/>
|
||||
</action>
|
||||
|
||||
<!-- plexus security actions -->
|
||||
|
||||
<!--
|
||||
<action name="userDetails" class="userManagement" method="save">
|
||||
<result name="input">/WEB-INF/jsp/admin/userDetails.jsp</result>
|
||||
<result name="success" type="chain">user</result>
|
||||
<interceptor-ref name="configuredPrepareParamsStack"/>
|
||||
</action>
|
||||
|
||||
<action name="userManagement" class="userManagement" method="input">
|
||||
-->
|
||||
<action name="userManagement" class="userManagement" method="findUser">
|
||||
<result name="input">/WEB-INF/jsp/admin/findUser.jsp</result>
|
||||
<result name="success" type="chain">user</result>
|
||||
<result name="success" type="redirect-action">user</result>
|
||||
</action>
|
||||
|
||||
<action name="assignRoleToUser" class="plexusSecurityUserAssignment" method="assignRole">
|
||||
<result name="success" type="chain">user</result>
|
||||
<result name="success" type="redirect-action">user</result>
|
||||
</action>
|
||||
|
||||
<action name="removeRoleFromUser" class="plexusSecurityUserAssignment" method="removeRole">
|
||||
<result name="success" type="chain">user</result>
|
||||
<result name="success" type="redirect-action">user</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
<pss:ifAnyAuthorized permissions="edit-configuration,edit-all-users">
|
||||
<li class="expanded">
|
||||
<pss:ifAuthorized permission="edit-all-users">
|
||||
<my:currentWWUrl action="userManagement" namespace="/admin">User Management</my:currentWWUrl>
|
||||
<my:currentWWUrl action="userManagement!input" namespace="/admin">User Management</my:currentWWUrl>
|
||||
</pss:ifAuthorized>
|
||||
</li>
|
||||
<li>
|
||||
|
|
Loading…
Reference in New Issue