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:
Jesse McConnell 2006-09-14 06:05:59 +00:00
parent 3ca919b9f3
commit 997a1988c0
3 changed files with 34 additions and 26 deletions

View File

@ -73,10 +73,17 @@ 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 );
}
session.put( "MANAGED_USERNAME", username );
principal = user.getPrincipal().toString();
fullName = user.getFullName();
@ -92,7 +99,7 @@ public class UserManagementAction
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

View File

@ -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>

View File

@ -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>