* under the License.
*/
+import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.rest.api.model.BrowseResult;
import org.apache.archiva.rest.api.model.VersionsList;
@GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
@RedbackAuthorization( noPermission = true, noRestriction = true )
- List<String> getUserRepositories()
+ List<ManagedRepository> getUserRepositories()
throws ArchivaRestServiceException;
}
private List<AuditListener> auditListeners = new ArrayList<AuditListener>();
@Inject
- private UserRepositories userRepositories;
+ protected UserRepositories userRepositories;
@Inject
* under the License.
*/
+import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.repository.MetadataResolutionException;
}
}
- public List<String> getUserRepositories()
+ public List<ManagedRepository> getUserRepositories()
throws ArchivaRestServiceException
{
- return getObservableRepos();
+ return userRepositories.getAccessibleRepositories( )
}
//---------------------------
return repoIds;
}
- public List<ManagedRepository> getAccessibleRepositories( String principal, String operation )
+ public List<ManagedRepository> getAccessibleRepositories( String principal )
+ throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException
+ {
+ return getAccessibleRepositories( principal, ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS );
+ }
+
+ private List<ManagedRepository> getAccessibleRepositories( String principal, String operation )
throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException
{
SecuritySession securitySession = createSession( principal );
/**
*
* @param principal
- * @param operation
* @since 1.4-M3
* @return
* @throws ArchivaSecurityException
* @throws AccessDeniedException
* @throws PrincipalNotFoundException
*/
- List<ManagedRepository> getAccessibleRepositories( String principal, String operation )
+ List<ManagedRepository> getAccessibleRepositories( String principal )
throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException;
}
this.repoIds = repoIds;
}
- public List<ManagedRepository> getAccessibleRepositories( String principal, String operation )
+ public List<ManagedRepository> getAccessibleRepositories( String principal )
throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException
{
return Collections.emptyList();