// TODO: Use the Redback / UserConfiguration..getString( "redback.default.guest" ) to get the right name.
String principal = "guest";
try
{
UserAssignment ua;
if ( rbacManager.userAssignmentExists( principal ) )
{
ua = rbacManager.getUserAssignment( principal );
}
else
{
ua = rbacManager.createUserAssignment( principal );
}
ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) );
rbacManager.saveUserAssignment( ua );
}
catch ( RbacManagerException e )
{
getLogger().warn( "Unable to add role [" + ArchivaRoleConstants.toRepositoryObserverRoleName( repoId )