archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1389245 - in /archiva/trunk/archiva-modules: archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/
Date Mon, 24 Sep 2012 08:45:49 GMT
Author: olamy
Date: Mon Sep 24 08:45:49 2012
New Revision: 1389245

URL: http://svn.apache.org/viewvc?rev=1389245&view=rev
Log:
merge repositories rest service: users must have karma for this operation

Modified:
    archiva/trunk/archiva-modules/archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ArchivaRoleConstants.java
    archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ArchivaRoleConstants.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ArchivaRoleConstants.java?rev=1389245&r1=1389244&r2=1389245&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ArchivaRoleConstants.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ArchivaRoleConstants.java
Mon Sep 24 08:45:49 2012
@@ -65,6 +65,8 @@ public class ArchivaRoleConstants
     public static final String OPERATION_REPOSITORY_UPLOAD = "archiva-upload-repository";
 
     public static final String OPERATION_REPOSITORY_DELETE = "archiva-delete-artifact";
+
+    public static final String OPERATION_MERGE_REPOSITORY = "archiva-merge-repository";
     
     public static final String OPERATION_VIEW_AUDIT_LOG = "archiva-view-audit-logs";
 

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java?rev=1389245&r1=1389244&r2=1389245&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/MergeRepositoriesService.java
Mon Sep 24 08:45:49 2012
@@ -20,6 +20,7 @@ package org.apache.archiva.rest.api.serv
 
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.security.common.ArchivaRoleConstants;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -34,30 +35,30 @@ import java.util.List;
  * @author Olivier Lamy
  * @since 1.4-M3
  */
-@Path ( "/mergeRepositoriesService/" )
+@Path ("/mergeRepositoriesService/")
 public interface MergeRepositoriesService
 {
-    @Path ( "mergeConflictedArtifacts/{sourceRepositoryId}/{targetRepositoryId}" )
+    @Path ("mergeConflictedArtifacts/{sourceRepositoryId}/{targetRepositoryId}")
     @GET
-    @Produces ( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
-    @RedbackAuthorization ( noPermission = true )
+    @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_MERGE_REPOSITORY)
     /**
      * <b>permissions are checked in impl</b>
      * @since 1.4-M3
      */
-    List<Artifact> getMergeConflictedArtifacts( @PathParam ( "sourceRepositoryId" )
String sourceRepositoryId,
-                                                @PathParam ( "targetRepositoryId" ) String
targetRepositoryId )
+    List<Artifact> getMergeConflictedArtifacts( @PathParam ("sourceRepositoryId") String
sourceRepositoryId,
+                                                @PathParam ("targetRepositoryId") String
targetRepositoryId )
         throws ArchivaRestServiceException;
 
-    @Path ( "mergeRepositories/{sourceRepositoryId}/{targetRepositoryId}/{skipConflicts}"
)
+    @Path ("mergeRepositories/{sourceRepositoryId}/{targetRepositoryId}/{skipConflicts}")
     @GET
-    @RedbackAuthorization ( noPermission = true )
+    @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_MERGE_REPOSITORY)
     /**
      * <b>permissions are checked in impl</b>
      * @since 1.4-M3
      */
-    void mergeRepositories( @PathParam ( "sourceRepositoryId" ) String sourceRepositoryId,
-                            @PathParam ( "targetRepositoryId" ) String targetRepositoryId,
-                            @PathParam ( "skipConflicts" ) boolean skipConflicts )
+    void mergeRepositories( @PathParam ("sourceRepositoryId") String sourceRepositoryId,
+                            @PathParam ("targetRepositoryId") String targetRepositoryId,
+                            @PathParam ("skipConflicts") boolean skipConflicts )
         throws ArchivaRestServiceException;
 }



Mime
View raw message