]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-2727: AuthZ management resources were not responding to gets of /accountroles...
authorRichard Millet <richard.millet@berkeley.edu>
Thu, 26 Aug 2010 20:03:11 +0000 (20:03 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Thu, 26 Aug 2010 20:03:11 +0000 (20:03 +0000)
services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java
services/authorization-mgt/service/src/main/java/org/collectionspace/services/authorization/PermissionResource.java
services/authorization-mgt/service/src/main/java/org/collectionspace/services/authorization/RoleResource.java
services/authorization/jaxb/src/main/resources/accounts_roles.xsd
services/authorization/jaxb/src/main/resources/permissions_roles.xsd
services/common/src/main/java/org/collectionspace/services/common/security/SecurityInterceptor.java

index 43a024aa143577271f2f52b08965842535a55a31..e40ca7ca94330499d9b9d55e5f618fbc0fda6bd8 100644 (file)
@@ -436,10 +436,10 @@ public class AccountResource
     }
 
     @GET
-    @Path("{csid}/accountroles/{accrolecsid}")
+    @Path("{csid}/accountroles/{id}")
     public AccountRoleRel getAccountRole(
             @PathParam("csid") String accCsid,
-            @PathParam("accrolecsid") String accrolecsid) {
+            @PathParam("id") String accrolecsid) {
         if (logger.isDebugEnabled()) {
             logger.debug("getAccountRole with accCsid=" + accCsid);
         }
index 367076a0589a475de1ea773ab8564eabf3b58279..61e20083742047c3caf07eb4dd602151ccf52c08 100644 (file)
@@ -443,10 +443,10 @@ public class PermissionResource
     }
 
     @GET
-    @Path("{csid}/permroles/{permrolecsid}")
+    @Path("{csid}/permroles/{id}")
     public PermissionRoleRel getPermissionRole(
             @PathParam("csid") String permCsid,
-            @PathParam("permrolecsid") String permrolecsid) {
+            @PathParam("id") String permrolecsid) {
         if (logger.isDebugEnabled()) {
             logger.debug("getPermissionRole with permCsid=" + permCsid);
         }
index 4aa34d5697f24e991a65d201bb84615274da1709..bc337392ebac16822d506e1f18d061f070da862f 100644 (file)
@@ -505,10 +505,10 @@ public class RoleResource
     }
 
     @GET
-    @Path("{csid}/permroles/{permrolecsid}")
+    @Path("{csid}/permroles/{id}")
     public PermissionRoleRel getRolePermission(
             @PathParam("csid") String roleCsid,
-            @PathParam("permrolecsid") String permrolecsid) {
+            @PathParam("id") String permrolecsid) {
         if (logger.isDebugEnabled()) {
             logger.debug("getRolePermission with roleCsid=" + roleCsid);
         }
index ca932e36cf8409024c67c19b658b270d8eeb0e6b..2acd1c59364c9f4a9a2586f16055f460e0967c03 100644 (file)
@@ -68,6 +68,7 @@
         </xs:sequence>
     </xs:complexType>
 
+<!-- Currently not used.  May be part of 1.x future release -->
     <xs:complexType name="AuthorizationRoleRel">
         <xs:annotation>
             <xs:appinfo>
@@ -76,6 +77,7 @@
         </xs:annotation>
     </xs:complexType>
 
+       <xs:element name="account_role_rel" type="account_role_rel"/>
     <xs:complexType name="account_role_rel">        
         <xs:annotation>
             <xs:documentation>AccountRole defines association between account and role in CollectionSpace</xs:documentation>
index e31f41e5590c2cffdaab63c1a3f7290678535fc6..b3574025b436a9a2b18ba1bb6e109212134c0ac2 100644 (file)
@@ -68,6 +68,7 @@
         </xs:sequence>
     </xs:complexType>
 
+       <xs:element name="permission_role_rel" type="permission_role_rel"/>
     <xs:complexType name="permission_role_rel">
         <xs:annotation>
             <xs:documentation>
index 152e4af677ea2d6f2b016a7ed4a402c574fd5616..69c2624523136750a2851e2402d254966272c0e1 100644 (file)
@@ -160,12 +160,12 @@ public class SecurityInterceptor implements PreProcessInterceptor {
                for (String pathParamName : pathParams.keySet()) {
                        //assumption : path params for csid for any entity has substring csid in name
                        String pathParamValue = pathParams.get(pathParamName).get(0);
-                       if ((pathParamName.toLowerCase().indexOf("ms") > -1)) {
+                       if ((pathParamName.toLowerCase().indexOf("csid") > -1)) {
                                //replace csids with wildcard
                                uriPath = uriPath.replace(pathParamValue, "*");
                        }
-                       if ((pathParamName.toLowerCase().indexOf("csid") > -1)) {
-                               //replace csids with wildcard
+                       if ((pathParamName.toLowerCase().indexOf("id") > -1)) {
+                               //replace id with wildcard
                                uriPath = uriPath.replace(pathParamValue, "*");
                        }
                        if ((pathParamName.toLowerCase().indexOf("predicate") > -1)) {
@@ -177,6 +177,10 @@ public class SecurityInterceptor implements PreProcessInterceptor {
                                uriPath = uriPath.replace("urn:cspace:name(" + pathParamValue
                                                + ")", "*");
                        }
+                       if ((pathParamName.toLowerCase().indexOf("ms") > -1)) {
+                               //replace csids with wildcard
+                               uriPath = uriPath.replace(pathParamValue, "*");
+                       }
                }
                uriPath = uriPath.replace("//", "/");
                return uriPath;