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()
|
public void prepare()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
if ( username == null || "".equals( username ) )
|
||||||
if ( username != null )
|
{
|
||||||
|
user = userManager.findUser( (String) session.get( "MANAGED_USERNAME" ) );
|
||||||
|
username = user.getUsername();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
user = userManager.findUser( username );
|
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
|
* @return
|
||||||
*/
|
*/
|
||||||
public String input()
|
public String findUser()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( username != null )
|
if ( username != null )
|
||||||
{
|
{
|
||||||
user = userManager.findUser( username );
|
user = userManager.findUser( username );
|
||||||
|
session.put( "MANAGED_USERNAME", username );
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -255,29 +255,29 @@
|
||||||
|
|
||||||
<action name="user" class="userManagement">
|
<action name="user" class="userManagement">
|
||||||
<result name="success">/WEB-INF/jsp/admin/user.jsp</result>
|
<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"/>
|
<interceptor-ref name="configuredPrepareParamsStack"/>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<!-- plexus security actions -->
|
<!-- plexus security actions -->
|
||||||
|
<!--
|
||||||
<action name="userDetails" class="userManagement" method="save">
|
<action name="userDetails" class="userManagement" method="save">
|
||||||
<result name="input">/WEB-INF/jsp/admin/userDetails.jsp</result>
|
<result name="input">/WEB-INF/jsp/admin/userDetails.jsp</result>
|
||||||
<result name="success" type="chain">user</result>
|
<result name="success" type="chain">user</result>
|
||||||
<interceptor-ref name="configuredPrepareParamsStack"/>
|
<interceptor-ref name="configuredPrepareParamsStack"/>
|
||||||
</action>
|
</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="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>
|
||||||
|
|
||||||
<action name="assignRoleToUser" class="plexusSecurityUserAssignment" method="assignRole">
|
<action name="assignRoleToUser" class="plexusSecurityUserAssignment" method="assignRole">
|
||||||
<result name="success" type="chain">user</result>
|
<result name="success" type="redirect-action">user</result>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action name="removeRoleFromUser" class="plexusSecurityUserAssignment" method="removeRole">
|
<action name="removeRoleFromUser" class="plexusSecurityUserAssignment" method="removeRole">
|
||||||
<result name="success" type="chain">user</result>
|
<result name="success" type="redirect-action">user</result>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
</package>
|
</package>
|
||||||
|
|
|
@ -124,7 +124,7 @@
|
||||||
<pss:ifAnyAuthorized permissions="edit-configuration,edit-all-users">
|
<pss:ifAnyAuthorized permissions="edit-configuration,edit-all-users">
|
||||||
<li class="expanded">
|
<li class="expanded">
|
||||||
<pss:ifAuthorized permission="edit-all-users">
|
<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>
|
</pss:ifAuthorized>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|
Loading…
Reference in New Issue