List<ManagedRepository> getUserRepositories()
throws ArchivaRestServiceException;
+ /**
+ * @return List of repositories current user can manage
+ */
+ @Path("userManagableRepositories")
+ @GET
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @RedbackAuthorization(noPermission = true, noRestriction = true)
+ List<ManagedRepository> getUserManagableRepositories()
+ throws ArchivaRestServiceException;
+
/**
* return the dependency Tree for an artifacts
* <b>the List result has only one entry</b>
}
}
+ @Override
+ public List<ManagedRepository> getUserManagableRepositories() throws ArchivaRestServiceException {
+ try
+ {
+ return userRepositories.getManagableRepositories( getPrincipal() );
+ }
+ catch ( ArchivaSecurityException e )
+ {
+ throw new ArchivaRestServiceException( "repositories.read.managable.error",
+ Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e );
+ }
+ }
+
@Override
public List<Artifact> getDependees( String groupId, String artifactId, String version, String repositoryId )
throws ArchivaRestServiceException
return getAccessibleRepositories( principal, ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS );
}
+ @Override
+ public List<ManagedRepository> getManagableRepositories(String principal) throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException {
+ return getAccessibleRepositories( principal, ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD );
+ }
+
private List<ManagedRepository> getAccessibleRepositories( String principal, String operation )
throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException
{
*/
List<ManagedRepository> getAccessibleRepositories( String principal )
throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException;
+
+ /**
+ *
+ * Returns a list of repositories for which the user has the manager role.
+ *
+ * @param principal
+ * @since 2.2.2
+ * @return
+ * @throws ArchivaSecurityException
+ * @throws AccessDeniedException
+ * @throws PrincipalNotFoundException
+ */
+ List<ManagedRepository> getManagableRepositories( String principal )
+ throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException;
}
{
return Collections.emptyList();
}
+
+ @Override
+ public List<ManagedRepository> getManagableRepositories(String principal) throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException {
+ return Collections.emptyList();
+ }
}
dataType: 'json',
success: function(data) {
mainContent.html($("#file-upload-screen").html());
- $.ajax("restServices/archivaServices/browseService/userRepositories", {
+ $.ajax("restServices/archivaServices/browseService/userManagableRepositories", {
type: "GET",
dataType: 'json',
success: function(data) {