directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-core git commit: FC-186 - pass tenantid for groupmgr funcs
Date Thu, 06 Oct 2016 21:20:30 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 415f16959 -> b391b0140


 FC-186 - pass tenantid for groupmgr funcs


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

Branch: refs/heads/master
Commit: b391b0140b6a4a1cbd087f6ac062ff0398db0137
Parents: 415f169
Author: Shawn McKinney <smckinney@apache.org>
Authored: Thu Oct 6 14:32:12 2016 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Thu Oct 6 14:32:12 2016 -0500

----------------------------------------------------------------------
 .../fortress/core/impl/GroupMgrImpl.java        | 20 ++++++++++++--------
 .../directory/fortress/core/impl/GroupP.java    |  1 +
 2 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b391b014/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java
index 195471d..2c681d0 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java
@@ -203,18 +203,22 @@ public class GroupMgrImpl extends Manageable implements GroupMgr, Serializable
         String methodName = "assign";
         assertContext(CLS_NM, methodName, group, GlobalErrIds.GROUP_NULL);
         checkAccess(CLS_NM, methodName);
-        ReviewMgr reviewMgr = ReviewMgrFactory.createInstance();
+        ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( this.contextId );
         String dn;
         if( group.getType() == Group.Type.ROLE )
         {
-            Role role = reviewMgr.readRole( new Role( member ) );
+            Role inRole = new Role( member );
+            inRole.setContextId( group.getContextId() );
+            Role role = reviewMgr.readRole( inRole );
             dn = role.getDn();
             // Validate SSD constraints
             SDUtil.getInstance().validateSSD( group, role );
         }
         else
         {
-            User user = reviewMgr.readUser( new User( member ) );
+            User inUser = new User( member );
+            inUser.setContextId( group.getContextId() );
+            User user = reviewMgr.readUser( inUser );
             dn = user.getDn();
         }
 
@@ -230,7 +234,7 @@ public class GroupMgrImpl extends Manageable implements GroupMgr, Serializable
         String methodName = "deassign";
         assertContext(CLS_NM, methodName, group, GlobalErrIds.GROUP_NULL);
         checkAccess(CLS_NM, methodName);
-        ReviewMgr reviewMgr = ReviewMgrFactory.createInstance();
+        ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( this.contextId );
         String dn;
         if( group.getType() == Group.Type.ROLE )
         {
@@ -250,7 +254,7 @@ public class GroupMgrImpl extends Manageable implements GroupMgr, Serializable
     {
         if( CollectionUtils.isNotEmpty( group.getMembers() ))
         {
-            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance();
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( this.contextId );
             List<String> userDns = new ArrayList<String>();
             
             for( String member : group.getMembers() )
@@ -267,7 +271,7 @@ public class GroupMgrImpl extends Manageable implements GroupMgr, Serializable
     {
         if( CollectionUtils.isNotEmpty( group.getMembers() ))
         {
-            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance();
+            ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( this.contextId );
             List<String> roleDns = new ArrayList<String>();
 
             for( String member : group.getMembers() )
@@ -282,14 +286,14 @@ public class GroupMgrImpl extends Manageable implements GroupMgr, Serializable
 
     private void loadUserDn( User inUser ) throws SecurityException
     {
-        ReviewMgr reviewMgr = ReviewMgrFactory.createInstance();
+        ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( this.contextId );
         User outUser = reviewMgr.readUser( inUser );
         inUser.setDn( outUser.getDn() );
     }
 
     private void loadRoleDn( Role inRole ) throws SecurityException
     {
-        ReviewMgr reviewMgr = ReviewMgrFactory.createInstance();
+        ReviewMgr reviewMgr = ReviewMgrFactory.createInstance( this.contextId );
         Role outRole = reviewMgr.readRole( inRole );
         inRole.setDn( outRole.getDn() );
     }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/b391b014/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java b/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java
index 47eedf7..d284cdc 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java
@@ -172,6 +172,7 @@ final class GroupP
     Group read( Group group ) throws SecurityException
     {
         Group outGroup = gDao.get(group);
+        outGroup.setContextId( group.getContextId() );
         fillRoles(outGroup);
         return outGroup;
     }


Mime
View raw message