}
@Override
- public Map<String, Role> getChildRoles( Role role )
+ public Map<String, Role> getChildRoleNames( Role role )
throws RbacManagerException
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
- public Map<String, Role> getParentRoles( Role role )
+ public Map<String, ? extends Role> getChildRoleIds( Role role ) throws RbacManagerException
+ {
+ return null;
+ }
+
+ @Override
+ public Map<String, Role> getParentRoleNames( Role role )
throws RbacManagerException
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
+ @Override
+ public Map<String, ? extends Role> getParentRoleIds( Role role ) throws RbacManagerException
+ {
+ return null;
+ }
+
@Override
public List<Role> getAllRoles()
throws RbacManagerException
}
@Override
- public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
+ public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleIds )
throws RbacManagerException
{
return null; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
- public void createTemplatedRole( String templateId, String resource )
+ public String createTemplatedRole( String templateId, String resource )
throws RoleManagerException
{
//To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
@Override
}
@Override
- public void moveTemplatedRole( String templateId, String oldResource, String newResource )
+ public String moveTemplatedRole( String templateId, String oldResource, String newResource )
throws RoleManagerException
{
//To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
@Override
public static final String REPOSITORY_MANAGER_ROLE_PREFIX = "Repository Manager";
public static final String REPOSITORY_OBSERVER_ROLE_PREFIX = "Repository Observer";
+ public static final String REPOSITORY_OBSERVER_ROLE_ID_PREFIX = "archiva-repository-observer";
// operations
public static final String OPERATION_MANAGE_USERS = "archiva-manage-users";
{
return REPOSITORY_OBSERVER_ROLE_PREFIX + " - " + repoId;
}
+
+ public static String toRepositoryObserverRoleId( String repoId )
+ {
+ return REPOSITORY_OBSERVER_ROLE_ID_PREFIX + "." + repoId;
+ }
}
log.info( "ignore RbacObjectNotFoundException for id {} during restoreGuestInitialValues", userId );
return;
}
- userAssignment.setRoleNames( new ArrayList( Arrays.asList( "Guest" ) ) );
+ userAssignment.setRoleIds( new ArrayList( Arrays.asList( "guest" ) ) );
rbacManager.saveUserAssignment( userAssignment );
CacheManager.getInstance().clearAll();
}
continue;
}
List<String> roles = new ArrayList<>();
- roles.add( RedbackRoleConstants.SYSTEM_ADMINISTRATOR_ROLE );
+ roles.add( RedbackRoleConstants.SYSTEM_ADMINISTRATOR_ROLE_ID );
List<? extends UserAssignment> systemAdminstrators;
try
UserAssignment userAssignment = rbacManager.getUserAssignment( principal );
if ( userAssignment != null )
{
- for ( String roleName : userAssignment.getRoleNames() )
+ for ( String roleId : userAssignment.getRoleIds() )
{
- ua.addRoleName( roleName );
+ ua.addRoleId( roleId );
}
}
}
UserAssignment userAssignment = allUserAssignments.get( ua.getPrincipal() );
if ( userAssignment != null )
{
- for ( String roleName : ua.getRoleNames() )
+ for ( String roleId : ua.getRoleIds() )
{
- userAssignment.addRoleName( roleName );
+ userAssignment.addRoleId( roleId );
}
}
allUserAssignments.put( ua.getPrincipal(), ua );
}
@Override
- public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
+ public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleIds )
throws RbacManagerException
{
List<UserAssignment> allUserAssignments = new ArrayList<>();
{
try
{
- List<? extends UserAssignment> userAssignments = rbacManager.getUserAssignmentsForRoles( roleNames );
+ List<? extends UserAssignment> userAssignments = rbacManager.getUserAssignmentsForRoles( roleIds );
allUserAssignments.addAll( userAssignments );
ua = rbacManager.createUserAssignment( principal );
}
- ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) );
+ ua.addRoleId( ArchivaRoleConstants.toRepositoryObserverRoleId( repoId ) );
rbacManager.saveUserAssignment( ua );
}
catch ( RbacManagerException e )
{
- log.warn( "Unable to add role [{}] to {} user.", ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ), principal, e );
+ log.warn( "Unable to add role [{}] to {} user.", ArchivaRoleConstants.toRepositoryObserverRoleId( repoId ), principal, e );
}
}
}
}
@Override
- public void createTemplatedRole( String templateId, String resource )
+ public String createTemplatedRole( String templateId, String resource )
throws RoleManagerException
{
//To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
@Override
}
@Override
- public void moveTemplatedRole( String templateId, String oldResource, String newResource )
+ public String moveTemplatedRole( String templateId, String oldResource, String newResource )
throws RoleManagerException
{
//To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
@Override