mirror of
https://github.com/apache/archiva.git
synced 2025-03-01 14:09:08 +00:00
MRM-242 added a new base role for the repository managers to inherit
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@482705 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c39256f003
commit
fcdfd86088
@ -29,6 +29,8 @@ public class ArchivaRoleConstants
|
||||
|
||||
public static final String GUEST_ROLE = "Guest";
|
||||
|
||||
public static final String BASE_REPOSITORY_MANAGER = "Repository Manager Base";
|
||||
|
||||
// dynamic role prefixes
|
||||
public static final String REPOSITORY_MANAGER_ROLE_PREFIX = "Repository Manager";
|
||||
|
||||
|
@ -32,6 +32,8 @@ public class ArchivaRoleProfileManager
|
||||
public void initialize()
|
||||
throws RoleProfileException
|
||||
{
|
||||
getRole( "archiva-repository-manager-base" );
|
||||
|
||||
mergeRoleProfiles( "system-administrator", "archiva-system-administrator" );
|
||||
mergeRoleProfiles( "user-administrator", "archiva-user-administrator" );
|
||||
mergeRoleProfiles( "guest", "archiva-guest" );
|
||||
|
@ -0,0 +1,42 @@
|
||||
package org.apache.maven.archiva.security;
|
||||
|
||||
import org.codehaus.plexus.rbac.profile.AbstractRoleProfile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @plexus.component role="org.codehaus.plexus.rbac.profile.RoleProfile"
|
||||
* role-hint="archiva-repository-manager-base"
|
||||
*/
|
||||
public class BaseRepositoryManagerRoleProfile
|
||||
extends AbstractRoleProfile
|
||||
{
|
||||
/**
|
||||
* Create the Role name for a Repository Manager, using the provided repository id.
|
||||
*
|
||||
*/
|
||||
public String getRoleName( )
|
||||
{
|
||||
return ArchivaRoleConstants.BASE_REPOSITORY_MANAGER;
|
||||
}
|
||||
|
||||
public List getOperations()
|
||||
{
|
||||
List operations = new ArrayList();
|
||||
|
||||
operations.add( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION );
|
||||
|
||||
return operations;
|
||||
}
|
||||
|
||||
public boolean isPermanent()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isAssignable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -52,6 +52,12 @@ public List getOperations()
|
||||
return operations;
|
||||
}
|
||||
|
||||
|
||||
public List getChildRoles()
|
||||
{
|
||||
return Collections.singletonList( ArchivaRoleConstants.BASE_REPOSITORY_MANAGER );
|
||||
}
|
||||
|
||||
public List getDynamicChildRoles( String string )
|
||||
{
|
||||
return Collections.singletonList(
|
||||
|
@ -80,6 +80,20 @@
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
<component>
|
||||
<role>org.codehaus.plexus.rbac.profile.RoleProfile</role>
|
||||
<role-hint>archiva-repository-manager-base</role-hint>
|
||||
<implementation>org.apache.maven.archiva.security.BaseRepositoryManagerRoleProfile</implementation>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.security.rbac.RBACManager</role>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.PlexusContainer</role>
|
||||
<field-name>container</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
<component>
|
||||
<role>org.codehaus.plexus.rbac.profile.DynamicRoleProfile</role>
|
||||
<role-hint>archiva-repository-manager</role-hint>
|
||||
|
Loading…
x
Reference in New Issue
Block a user