airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: fixing getAllAccessibleUsers issue
Date Tue, 12 Jul 2016 23:25:01 GMT
Repository: airavata
Updated Branches:
  refs/heads/grouper-integration 2e7ecb3f9 -> d12f590e8


fixing getAllAccessibleUsers issue


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/d12f590e
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/d12f590e
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/d12f590e

Branch: refs/heads/grouper-integration
Commit: d12f590e807c84310e879b9c3241a748ba7a553f
Parents: 2e7ecb3
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Tue Jul 12 19:24:57 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue Jul 12 19:24:57 2016 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/airavata/grouper/GroupManagerImpl.java | 5 +++++
 .../apache/airavata/grouper/resource/ResourceServiceImpl.java   | 2 ++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d12f590e/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerImpl.java
b/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerImpl.java
index e90606c..59885c0 100644
--- a/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerImpl.java
+++ b/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerImpl.java
@@ -115,4 +115,9 @@ public class GroupManagerImpl implements GroupManagerCPI {
         groupMemberships.stream().forEach(gm->groupList.add(getGroup(gm.getGroupId())));
         return groupList;
     }
+
+    public static void main(String[] args) {
+        GroupManagerImpl groupManager = new GroupManagerImpl();
+        groupManager.getAllAccessibleUsers("TestProj4_ca7b95df-dd56-41b5-b112-d58b2748fc46",
ResourceType.PROJECT, PermissionAction.READ);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/d12f590e/modules/group-manager/src/main/java/org/apache/airavata/grouper/resource/ResourceServiceImpl.java
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/java/org/apache/airavata/grouper/resource/ResourceServiceImpl.java
b/modules/group-manager/src/main/java/org/apache/airavata/grouper/resource/ResourceServiceImpl.java
index 0b0ec06..a4cc29c 100755
--- a/modules/group-manager/src/main/java/org/apache/airavata/grouper/resource/ResourceServiceImpl.java
+++ b/modules/group-manager/src/main/java/org/apache/airavata/grouper/resource/ResourceServiceImpl.java
@@ -16,6 +16,7 @@ import edu.internet2.middleware.grouper.permissions.PermissionEntry;
 import edu.internet2.middleware.grouper.permissions.PermissionFinder;
 import edu.internet2.middleware.subject.Subject;
 import edu.internet2.middleware.subject.SubjectNotFoundException;
+import org.apache.airavata.grouper.AiravataGrouperUtil;
 import org.apache.airavata.grouper.SubjectType;
 import org.apache.airavata.grouper.group.GroupServiceImpl;
 import org.apache.airavata.grouper.permission.PermissionAction;
@@ -236,6 +237,7 @@ public class ResourceServiceImpl {
       Stem stem = StemFinder.findByName(grouperSession, resourceType.getStemFromResourceType(),
true);
       permissionFinder.assignPermissionNameFolder(stem);
       permissionFinder.assignPermissionNameFolderScope(Scope.ONE);
+      permissionFinder.addRole(AiravataGrouperUtil.ROLES_STEM_NAME+ ":" + resourceId + "_"
+ action.toString());
       Set<PermissionEntry> permissions = permissionFinder.findPermissions();
 
       for (PermissionEntry entry: permissions) {


Mime
View raw message