try
{
List<String> observableRepos = userRepositories.getObservableRepositoryIds( username );
if( observableRepos != null && observableRepos.size() > 1 )
{
return new AuthorizationResult( true, username, null );
}
else
{
return new AuthorizationResult( false, username, null );
}
}
catch ( ArchivaSecurityException e )
{
throw new XmlRpcException( 401, e.getMessage() );
}
}
else if ( methodName.equals( ServiceMethodsPermissionsMapping.PING ) )
{
return new AuthorizationResult( true, username, null );
}
else
{
return securitySystem.authorize( session, ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE );
}