directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-enmasse git commit: FC-189 - add GroupMgrRestImpl
Date Fri, 07 Oct 2016 22:40:39 GMT
Repository: directory-fortress-enmasse
Updated Branches:
  refs/heads/master b3098ab8a -> 2baf0e371


FC-189 - add GroupMgrRestImpl


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/commit/2baf0e37
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/tree/2baf0e37
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/diff/2baf0e37

Branch: refs/heads/master
Commit: 2baf0e37155327636a0ffaa07fdf0d32bd4a7bdd
Parents: b3098ab
Author: Shawn McKinney <smckinney@apache.org>
Authored: Fri Oct 7 17:40:36 2016 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Fri Oct 7 17:40:36 2016 -0500

----------------------------------------------------------------------
 .../directory/fortress/rest/FortressService.java  |  4 ++--
 .../fortress/rest/FortressServiceImpl.java        | 12 ++++++------
 .../directory/fortress/rest/GroupMgrImpl.java     | 18 ++++++++----------
 .../apache/directory/fortress/rest/EmTest.java    |  4 ++--
 4 files changed, 18 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/2baf0e37/src/main/java/org/apache/directory/fortress/rest/FortressService.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/rest/FortressService.java b/src/main/java/org/apache/directory/fortress/rest/FortressService.java
index 24fb421..b005fa7 100644
--- a/src/main/java/org/apache/directory/fortress/rest/FortressService.java
+++ b/src/main/java/org/apache/directory/fortress/rest/FortressService.java
@@ -6861,7 +6861,7 @@ public interface FortressService
      * @param request contains a reference to {@code FortRequest}
      * @return reference to {@code FortResponse}
      */
-    FortResponse assignGroupRole( FortRequest request );
+    FortResponse assignGroup(FortRequest request);
 
     /**
      * This command deletes the assignment of the User from the Role entities. The command
is
@@ -6901,7 +6901,7 @@ public interface FortressService
      * @param request contains a reference to {@code FortRequest}
      * @return reference to {@code FortResponse}
      */
-    FortResponse deassignGroupRole( FortRequest request );
+    FortResponse deassignGroup(FortRequest request);
 
     FortResponse addRoleConstraint( FortRequest request );
     FortResponse removeRoleConstraint( FortRequest request );

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/2baf0e37/src/main/java/org/apache/directory/fortress/rest/FortressServiceImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/rest/FortressServiceImpl.java b/src/main/java/org/apache/directory/fortress/rest/FortressServiceImpl.java
index 9d5ed50..1d43593 100644
--- a/src/main/java/org/apache/directory/fortress/rest/FortressServiceImpl.java
+++ b/src/main/java/org/apache/directory/fortress/rest/FortressServiceImpl.java
@@ -1988,23 +1988,23 @@ public class FortressServiceImpl implements FortressService
      * {@inheritDoc}
      */
     @POST
-    @Path("/" + HttpIds.GROUP_ROLE_ASGN + "/")
+    @Path("/" + HttpIds.GROUP_ASGN + "/")
     @RolesAllowed({SUPER_USER, REVIEW_MGR_USER})
     @Override
-    public FortResponse assignGroupRole(FortRequest request)
+    public FortResponse assignGroup(FortRequest request)
     {
-        return groupMgrImpl.assignGroupRole( request );
+        return groupMgrImpl.assignGroup( request );
     }
 
     /**
      * {@inheritDoc}
      */
     @POST
-    @Path("/" + HttpIds.GROUP_ROLE_DEASGN + "/")
+    @Path("/" + HttpIds.GROUP_DEASGN + "/")
     @RolesAllowed({SUPER_USER, REVIEW_MGR_USER})
     @Override
-    public FortResponse deassignGroupRole(FortRequest request)
+    public FortResponse deassignGroup(FortRequest request)
     {
-        return groupMgrImpl.deassignGroupRole( request );
+        return groupMgrImpl.deassignGroup( request );
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/2baf0e37/src/main/java/org/apache/directory/fortress/rest/GroupMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/rest/GroupMgrImpl.java b/src/main/java/org/apache/directory/fortress/rest/GroupMgrImpl.java
index 49653d8..def26b8 100644
--- a/src/main/java/org/apache/directory/fortress/rest/GroupMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/rest/GroupMgrImpl.java
@@ -179,7 +179,7 @@ class GroupMgrImpl extends AbstractMgrImpl
         return response;
     }
 
-    /* No qualifier */  FortResponse assignGroupRole( FortRequest request )
+    /* No qualifier */  FortResponse assignGroup(FortRequest request)
     {
         FortResponse response = createResponse();
 
@@ -187,10 +187,9 @@ class GroupMgrImpl extends AbstractMgrImpl
         {
             GroupMgr groupMgr = GroupMgrFactory.createInstance( request.getContextId() );
             groupMgr.setAdmin( request.getSession() );
-            UserRole inRole = (UserRole) request.getEntity();
-
-            Group inGroup = new Group( inRole.getUserId(), Group.Type.ROLE );
-            groupMgr.assign( inGroup, inRole.getName() );
+            Group inGroup = (Group) request.getEntity();
+            String member = request.getValue();
+            groupMgr.assign( inGroup, member );
         }
         catch ( SecurityException se )
         {
@@ -200,7 +199,7 @@ class GroupMgrImpl extends AbstractMgrImpl
         return response;
     }
 
-    /* No qualifier */  FortResponse deassignGroupRole( FortRequest request )
+    /* No qualifier */  FortResponse deassignGroup(FortRequest request)
     {
         FortResponse response = createResponse();
 
@@ -208,10 +207,9 @@ class GroupMgrImpl extends AbstractMgrImpl
         {
             GroupMgr groupMgr = GroupMgrFactory.createInstance( request.getContextId() );
             groupMgr.setAdmin( request.getSession() );
-            UserRole inRole = (UserRole) request.getEntity();
-
-            Group inGroup = new Group( inRole.getUserId(), Group.Type.ROLE);
-            groupMgr.deassign( inGroup, inRole.getName() );
+            Group inGroup = (Group) request.getEntity();
+            String member = request.getValue();
+            groupMgr.deassign( inGroup, member );
         }
         catch ( SecurityException se )
         {

http://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse/blob/2baf0e37/src/test/java/org/apache/directory/fortress/rest/EmTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/rest/EmTest.java b/src/test/java/org/apache/directory/fortress/rest/EmTest.java
index 22a474e..5273606 100644
--- a/src/test/java/org/apache/directory/fortress/rest/EmTest.java
+++ b/src/test/java/org/apache/directory/fortress/rest/EmTest.java
@@ -106,10 +106,10 @@ public final class EmTest
             testFunction("groupRead.xml", HttpIds.GROUP_READ, true);
 
             // Assign 'emrole3' role for group to check api
-            testFunction("assignEmGroup1.xml", HttpIds.GROUP_ROLE_ASGN, true);
+            testFunction("assignEmGroup1.xml", HttpIds.GROUP_ASGN, true);
 
             // Deassign existing 'emrole3' from group
-            testFunction("assignEmGroup1.xml", HttpIds.GROUP_ROLE_DEASGN, true);
+            testFunction("assignEmGroup1.xml", HttpIds.GROUP_DEASGN, true);
 
             // Read group roles
             testFunction("groupRead.xml", HttpIds.GROUP_ROLE_ASGNED, true);


Mime
View raw message