airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata git commit: WIP
Date Fri, 07 Oct 2016 16:50:07 GMT
Repository: airavata
Updated Branches:
  refs/heads/airavata-gov-registry 10f30a96f -> d5f0b7771


WIP


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

Branch: refs/heads/airavata-gov-registry
Commit: 8c0cd2ec1e477e655a2f9f73fd28b3b7cdac3bb7
Parents: 10f30a9
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Oct 7 12:45:36 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Oct 7 12:45:36 2016 -0400

----------------------------------------------------------------------
 .../lib/airavata/group_manager_model_types.cpp  |   3 +
 .../lib/airavata/group_manager_model_types.h    |   3 +
 .../lib/Airavata/Model/Group/Types.php          |   3 +
 .../lib/apache/airavata/model/group/ttypes.py   |   3 +
 .../airavata/grouper/GroupManagerCPI.java       |   6 +
 .../airavata/grouper/GroupManagerImpl.java      |  19 ++
 .../apache/airavata/grouper/group/Group.java    |  67 +++++++
 .../airavata/grouper/group/GroupService.java    |  21 ++
 .../grouper/group/GroupServiceImpl.java         | 166 ++++++++++++++++
 .../grouper/resource/ResourceServiceImpl.java   | 198 +++++++++++++++++++
 .../airavata/grouper/role/RoleServiceImpl.java  |  42 ++++
 .../main/resources/grouper.hibernate.properties |  10 +
 .../src/main/resources/sources.xml              |   8 +
 13 files changed, 549 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.cpp
index 8f2d18d..e3f5562 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.cpp
@@ -54,6 +54,7 @@ const char* _kResourcePermissionTypeNames[] = {
 };
 const std::map<int, const char*> _ResourcePermissionType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kResourcePermissionTypeValues, _kResourcePermissionTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
 GroupModel::~GroupModel() throw() {
 }
@@ -250,4 +251,6 @@ void GroupModel::printTo(std::ostream& out) const {
   out << ")";
 }
 
+=======
+>>>>>>> adding more files
 }}}} // namespace

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.h
index e2e61b3..b35206c 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/group_manager_model_types.h
@@ -57,6 +57,7 @@ struct ResourcePermissionType {
 
 extern const std::map<int, const char*> _ResourcePermissionType_VALUES_TO_NAMES;
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 class GroupModel;
 
 typedef struct _GroupModel__isset {
@@ -139,6 +140,8 @@ inline std::ostream& operator<<(std::ostream& out, const GroupModel& obj)
   return out;
 }
 
+=======
+>>>>>>> adding more files
 }}}} // namespace
 
 #endif

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Group/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Group/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Group/Types.php
index 44f3db0..2fb5113 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Group/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Group/Types.php
@@ -39,6 +39,7 @@ final class ResourcePermissionType {
   );
 }
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 class GroupModel {
   static $_TSPEC;
 
@@ -232,4 +233,6 @@ class GroupModel {
 
 }
 
+=======
+>>>>>>> adding more files
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/group/ttypes.py
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/group/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/group/ttypes.py
index 661c390..5dd7e9e 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/group/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/group/ttypes.py
@@ -52,6 +52,7 @@ class ResourcePermissionType:
     "READ": 1,
   }
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
 class GroupModel:
   """
@@ -177,3 +178,5 @@ class GroupModel:
 
   def __ne__(self, other):
     return not (self == other)
+=======
+>>>>>>> adding more files

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerCPI.java
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerCPI.java b/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerCPI.java
index fcbbfef..e34c341 100644
--- a/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerCPI.java
+++ b/modules/group-manager/src/main/java/org/apache/airavata/grouper/GroupManagerCPI.java
@@ -1,6 +1,9 @@
 package org.apache.airavata.grouper;
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 import org.apache.airavata.grouper.group.Group;
+=======
+>>>>>>> adding more files
 import org.apache.airavata.grouper.permission.PermissionAction;
 import org.apache.airavata.grouper.resource.Resource;
 import org.apache.airavata.grouper.resource.ResourceType;
@@ -22,6 +25,7 @@ public interface GroupManagerCPI {
     Set<String> getAllAccessibleUsers(String resourceId, ResourceType resourceType, PermissionAction permissionType);
 
     List<String> getAccessibleResourcesForUser(String userId, ResourceType resourceType, PermissionAction permissionAction);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
     void createGroup(Group group);
 
@@ -32,4 +36,6 @@ public interface GroupManagerCPI {
     Group getGroup(String groupId);
 
     List<Group> getAllGroupsUserBelongs(String userId);
+=======
+>>>>>>> adding more files
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/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..cb4a4ce 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
@@ -20,6 +20,7 @@
 */
 package org.apache.airavata.grouper;
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 import org.apache.airavata.grouper.group.Group;
 import org.apache.airavata.grouper.group.GroupMembership;
 import org.apache.airavata.grouper.group.GroupServiceImpl;
@@ -27,6 +28,11 @@ import org.apache.airavata.grouper.permission.PermissionAction;
 import org.apache.airavata.grouper.permission.PermissionServiceImpl;
 import org.apache.airavata.grouper.resource.Resource;
 import org.apache.airavata.grouper.resource.ResourceNotFoundException;
+=======
+import org.apache.airavata.grouper.permission.PermissionAction;
+import org.apache.airavata.grouper.permission.PermissionServiceImpl;
+import org.apache.airavata.grouper.resource.Resource;
+>>>>>>> adding more files
 import org.apache.airavata.grouper.resource.ResourceServiceImpl;
 import org.apache.airavata.grouper.resource.ResourceType;
 import org.slf4j.Logger;
@@ -41,12 +47,18 @@ public class GroupManagerImpl implements GroupManagerCPI {
 
     private ResourceServiceImpl resourceService;
     private PermissionServiceImpl permissionService;
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
     private GroupServiceImpl groupService;
+=======
+>>>>>>> adding more files
 
     public GroupManagerImpl(){
         this.resourceService = new ResourceServiceImpl();
         this.permissionService = new PermissionServiceImpl();
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
         this.groupService = new GroupServiceImpl();
+=======
+>>>>>>> adding more files
     }
 
     @Override
@@ -56,11 +68,15 @@ public class GroupManagerImpl implements GroupManagerCPI {
 
     @Override
     public boolean isResourceRegistered(String resourceId, ResourceType resourceType) {
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
         try{
             return resourceService.getResource(resourceId, resourceType) != null;
         }catch (ResourceNotFoundException ex){
             return false;
         }
+=======
+        return resourceService.getResource(resourceId, resourceType) != null;
+>>>>>>> adding more files
     }
 
     @Override
@@ -87,6 +103,7 @@ public class GroupManagerImpl implements GroupManagerCPI {
         allResources.stream().forEach(r->ids.add(r.getId()));
         return ids;
     }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
     @Override
     public void createGroup(Group group) {
@@ -115,4 +132,6 @@ public class GroupManagerImpl implements GroupManagerCPI {
         groupMemberships.stream().forEach(gm->groupList.add(getGroup(gm.getGroupId())));
         return groupList;
     }
+=======
+>>>>>>> adding more files
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/Group.java
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/Group.java b/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/Group.java
index 76b5b94..2505c78 100755
--- a/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/Group.java
+++ b/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/Group.java
@@ -1,5 +1,9 @@
 /**
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
  *
+=======
+ * 
+>>>>>>> adding more files
  */
 package org.apache.airavata.grouper.group;
 
@@ -11,6 +15,7 @@ import java.util.List;
  *
  */
 public class Group {
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   private String id;
 
@@ -38,6 +43,17 @@ public class Group {
     this.id = id;
   }
 
+=======
+  
+  private String id;
+  
+  private String name;
+  
+  private String description;
+  
+  private List<String> users = new ArrayList<String>();
+  
+>>>>>>> adding more files
   /**
    * @return the id
    */
@@ -45,6 +61,18 @@ public class Group {
     return id;
   }
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
+=======
+  
+  /**
+   * @param id the id to set
+   */
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  
+>>>>>>> adding more files
   /**
    * @return the name
    */
@@ -52,7 +80,11 @@ public class Group {
     return name;
   }
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+  
+>>>>>>> adding more files
   /**
    * @param name the name to set
    */
@@ -60,6 +92,7 @@ public class Group {
     this.name = name;
   }
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   /**
    * @return the ownerId
@@ -69,6 +102,9 @@ public class Group {
   }
 
 
+=======
+  
+>>>>>>> adding more files
   /**
    * @return the description
    */
@@ -76,7 +112,11 @@ public class Group {
     return description;
   }
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+  
+>>>>>>> adding more files
   /**
    * @param description the description to set
    */
@@ -84,6 +124,7 @@ public class Group {
     this.description = description;
   }
 
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
   /**
    * @return the members
    */
@@ -105,4 +146,30 @@ public class Group {
         + ", description=" + description + "]";
   }
 
+=======
+  
+  /**
+   * @return the users
+   */
+  public List<String> getUsers() {
+    return users;
+  }
+
+  /**
+   * @param users the users to set
+   */
+  public void setUsers(List<String> users) {
+    this.users = users;
+  }
+
+
+  /**
+   * @see Object#toString()
+   */
+  @Override
+  public String toString() {
+    return "Group [id=" + id + ", name=" + name + ", description=" + description + "]";
+  }
+  
+>>>>>>> adding more files
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupService.java
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupService.java b/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupService.java
index cb4cccd..f6e4444 100755
--- a/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupService.java
+++ b/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupService.java
@@ -1,4 +1,5 @@
 /**
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
  *
  */
 package org.apache.airavata.grouper.group;
@@ -9,12 +10,20 @@ import edu.internet2.middleware.grouper.exception.GroupAddAlreadyExistsException
 import edu.internet2.middleware.grouper.exception.GroupNotFoundException;
 import edu.internet2.middleware.grouper.exception.InsufficientPrivilegeException;
 import edu.internet2.middleware.subject.SubjectNotFoundException;
+=======
+ * 
+ */
+package org.apache.airavata.grouper.group;
+
+import edu.internet2.middleware.grouper.exception.GroupNotFoundException;
+>>>>>>> adding more files
 
 /**
  * @author vsachdeva
  *
  */
 public interface GroupService {
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   void createGroup(Group group) throws SubjectNotFoundException, GroupAddAlreadyExistsException;
 
@@ -35,5 +44,17 @@ public interface GroupService {
   List<GroupMembership> getAllMembersForGroup(String groupId) throws GroupNotFoundException;
 
   List<GroupMembership> getAllMembershipsForUser(String userId) throws SubjectNotFoundException;
+=======
+  
+  public void createOrUpdateGroup(Group group);
+  
+  public void deleteGroup(String groupId) throws GroupNotFoundException;
+  
+  public Group getGroup(String groupId) throws GroupNotFoundException;
+  
+  public void addGroupToGroup(String parentGroupId, String childGroupId) throws GroupNotFoundException;
+  
+  public void removeGroupFromGroup(String parentGroupId, String childGroupId) throws GroupNotFoundException;
+>>>>>>> adding more files
 
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupServiceImpl.java
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupServiceImpl.java b/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupServiceImpl.java
index 114bed9..cd3a456 100755
--- a/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupServiceImpl.java
+++ b/modules/group-manager/src/main/java/org/apache/airavata/grouper/group/GroupServiceImpl.java
@@ -1,4 +1,5 @@
 /**
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
  *
  */
 package org.apache.airavata.grouper.group;
@@ -32,12 +33,36 @@ import edu.internet2.middleware.grouper.privs.AccessPrivilege;
 import edu.internet2.middleware.grouper.util.GrouperUtil;
 import edu.internet2.middleware.subject.Subject;
 import edu.internet2.middleware.subject.SubjectNotFoundException;
+=======
+ * 
+ */
+package org.apache.airavata.grouper.group;
+
+import edu.internet2.middleware.grouper.*;
+import edu.internet2.middleware.grouper.exception.GroupNotFoundException;
+import edu.internet2.middleware.grouper.group.TypeOfGroup;
+import edu.internet2.middleware.grouper.internal.dao.QueryOptions;
+import edu.internet2.middleware.grouper.util.GrouperUtil;
+import edu.internet2.middleware.subject.Subject;
+import edu.internet2.middleware.subject.SubjectNotFoundException;
+import org.apache.airavata.grouper.SubjectType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static edu.internet2.middleware.grouper.misc.SaveMode.INSERT_OR_UPDATE;
+import static edu.internet2.middleware.subject.provider.SubjectTypeEnum.PERSON;
+import static org.apache.airavata.grouper.AiravataGrouperUtil.*;
+import static org.apache.airavata.grouper.group.GroupMembershipType.DIRECT;
+import static org.apache.airavata.grouper.group.GroupMembershipType.INDIRECT;
+>>>>>>> adding more files
 
 /**
  * @author vsachdeva
  *
  */
 public class GroupServiceImpl implements GroupService {
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
 
   public void createGroup(Group group) throws SubjectNotFoundException, GroupAddAlreadyExistsException {
@@ -46,12 +71,22 @@ public class GroupServiceImpl implements GroupService {
     try {
       grouperSession = GrouperSession.startRootSession();
       Subject subject = SubjectFinder.findByIdAndSource(group.getOwnerId(), SUBJECT_SOURCE, true);
+=======
+  
+  
+  public void createOrUpdateGroup(Group group) {
+    
+    GrouperSession grouperSession = null;
+    try {
+      grouperSession = GrouperSession.startRootSession();
+>>>>>>> adding more files
       GroupSave groupSave = new GroupSave(grouperSession);
       groupSave.assignTypeOfGroup(TypeOfGroup.group);
       groupSave.assignGroupNameToEdit(GROUPS_STEM_NAME+COLON+group.getId());
       groupSave.assignName(GROUPS_STEM_NAME+COLON+group.getId());
       groupSave.assignDisplayExtension(group.getName());
       groupSave.assignDescription(group.getDescription());
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
       groupSave.assignSaveMode(SaveMode.INSERT);
       groupSave.assignCreateParentStemsIfNotExist(true);
       edu.internet2.middleware.grouper.Group grp = groupSave.save();
@@ -101,10 +136,22 @@ public class GroupServiceImpl implements GroupService {
       for (String userId: group.getMembers()) {
         Subject sub = SubjectFinder.findByIdAndSource(userId, SUBJECT_SOURCE, true);
         grp.addMember(sub, false);
+=======
+      groupSave.assignSaveMode(INSERT_OR_UPDATE);
+      groupSave.assignCreateParentStemsIfNotExist(true);
+      edu.internet2.middleware.grouper.Group grp = groupSave.save();
+      for (String userId: group.getUsers()) {
+        Subject subject = SubjectFinder.findByIdAndSource(userId, SUBJECT_SOURCE, false);
+        if (subject == null) {
+          throw new SubjectNotFoundException(userId+" airavata internal user id was not found.");
+        }
+        grp.addMember(subject, false);
+>>>>>>> adding more files
       }
     } finally {
       GrouperSession.stopQuietly(grouperSession);
     }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   }
 
@@ -127,11 +174,23 @@ public class GroupServiceImpl implements GroupService {
       if (!admin.getId().equals(subject.getId())) {
         throw new InsufficientPrivilegeException("Only the owner of the group can update.");
       }
+=======
+  }
+  
+  public void deleteGroup(String groupId) throws GroupNotFoundException {
+    
+    GrouperSession grouperSession = null;
+    try {
+      grouperSession = GrouperSession.startRootSession();
+      edu.internet2.middleware.grouper.Group group = GroupFinder.findByName(grouperSession, GROUPS_STEM_NAME+COLON+groupId, 
+          true, new QueryOptions().secondLevelCache(false));
+>>>>>>> adding more files
       group.delete();
     } finally {
       GrouperSession.stopQuietly(grouperSession);
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public Group getGroup(String groupId) throws GroupNotFoundException {
 
@@ -149,6 +208,17 @@ public class GroupServiceImpl implements GroupService {
         throw new RuntimeException("There is no admin for the group "+groupId+". It should have never happened.");
       }
       group = new Group(grouperGroup.getExtension(), admin.getId());
+=======
+  
+  public Group getGroup(String groupId) throws GroupNotFoundException {
+    
+    GrouperSession grouperSession = null;
+    Group group = new Group();
+    try {
+      grouperSession = GrouperSession.startRootSession();
+      edu.internet2.middleware.grouper.Group grouperGroup = GroupFinder.findByName(grouperSession, GROUPS_STEM_NAME+COLON+groupId, true);
+      group.setId(grouperGroup.getExtension());
+>>>>>>> adding more files
       group.setName(grouperGroup.getDisplayExtension());
       group.setDescription(grouperGroup.getDescription());
       List<String> users = new ArrayList<String>();
@@ -157,15 +227,25 @@ public class GroupServiceImpl implements GroupService {
           users.add(member.getSubjectId());
         }
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
       group.setMembers(users);
+=======
+      group.setUsers(users);
+>>>>>>> adding more files
     } finally {
       GrouperSession.stopQuietly(grouperSession);
     }
     return group;
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public void addGroupToGroup(String parentGroupId, String childGroupId, String ownerId) throws GroupNotFoundException, SubjectNotFoundException, InsufficientPrivilegeException {
 
+=======
+  
+  public void addGroupToGroup(String parentGroupId, String childGroupId) throws GroupNotFoundException {
+    
+>>>>>>> adding more files
     GrouperSession grouperSession = null;
     try {
       grouperSession = GrouperSession.startRootSession();
@@ -175,6 +255,7 @@ public class GroupServiceImpl implements GroupService {
       if (subject == null) {
         throw new GroupNotFoundException(childGroupId+" was not found.");
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
       Subject maybeAdmin = SubjectFinder.findByIdAndSource(ownerId, SUBJECT_SOURCE, true);
       Subject admin = null;
       // there will be one admin only.
@@ -197,14 +278,22 @@ public class GroupServiceImpl implements GroupService {
       if (!admin.getId().equals(maybeAdmin.getId())) {
         throw new InsufficientPrivilegeException("Only the owner of the group "+childGroupId+" can update.");
       }
+=======
+>>>>>>> adding more files
       grouperParentGroup.addMember(subject, false);
     } finally {
       GrouperSession.stopQuietly(grouperSession);
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public void removeGroupFromGroup(String parentGroupId, String childGroupId, String ownerId) throws GroupNotFoundException, SubjectNotFoundException, InsufficientPrivilegeException {
 
+=======
+  
+  public void removeGroupFromGroup(String parentGroupId, String childGroupId) throws GroupNotFoundException {
+    
+>>>>>>> adding more files
     GrouperSession grouperSession = null;
     try {
       grouperSession = GrouperSession.startRootSession();
@@ -214,6 +303,7 @@ public class GroupServiceImpl implements GroupService {
       if (subject == null) {
         throw new SubjectNotFoundException(childGroupId+" was not found.");
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
       Subject maybeAdmin = SubjectFinder.findByIdAndSource(ownerId, SUBJECT_SOURCE, true);
       Subject admin = null;
@@ -237,18 +327,26 @@ public class GroupServiceImpl implements GroupService {
       if (!admin.getId().equals(maybeAdmin.getId())) {
         throw new InsufficientPrivilegeException("Only the owner of the group "+childGroupId+" can update.");
       }
+=======
+>>>>>>> adding more files
       grouperParentGroup.deleteMember(subject, false);
     } finally {
       GrouperSession.stopQuietly(grouperSession);
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public void addUserToGroup(String userId, String groupId, String ownerId) throws SubjectNotFoundException, GroupNotFoundException, InsufficientPrivilegeException {
+=======
+  
+  public void addUserToGroup(String userId, String groupId) throws SubjectNotFoundException, GroupNotFoundException {
+>>>>>>> adding more files
     GrouperSession grouperSession = null;
     try {
       grouperSession = GrouperSession.startRootSession();
       edu.internet2.middleware.grouper.Group group = GroupFinder.findByName(grouperSession, GROUPS_STEM_NAME+COLON+groupId, true);
       Subject subject = SubjectFinder.findByIdAndSource(userId, SUBJECT_SOURCE, true);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
       Subject maybeAdmin = SubjectFinder.findByIdAndSource(ownerId, SUBJECT_SOURCE, true);
       Subject admin = null;
@@ -262,18 +360,26 @@ public class GroupServiceImpl implements GroupService {
       if (!admin.getId().equals(maybeAdmin.getId())) {
         throw new InsufficientPrivilegeException("Only the owner of the group can update.");
       }
+=======
+>>>>>>> adding more files
       group.addMember(subject, false);
     } finally {
       GrouperSession.stopQuietly(grouperSession);
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public void removeUserFromGroup(String userId, String groupId, String ownerId) throws SubjectNotFoundException, GroupNotFoundException, InsufficientPrivilegeException {
+=======
+  
+  public void removeUserFromGroup(String userId, String groupId) throws SubjectNotFoundException, GroupNotFoundException {
+>>>>>>> adding more files
     GrouperSession grouperSession = null;
     try {
       grouperSession = GrouperSession.startRootSession();
       edu.internet2.middleware.grouper.Group group = GroupFinder.findByName(grouperSession, GROUPS_STEM_NAME+COLON+groupId, true);
       Subject subject = SubjectFinder.findByIdAndSource(userId, SUBJECT_SOURCE, true);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
       Subject maybeAdmin = SubjectFinder.findByIdAndSource(ownerId, SUBJECT_SOURCE, true);
       Subject admin = null;
@@ -288,13 +394,20 @@ public class GroupServiceImpl implements GroupService {
         throw new InsufficientPrivilegeException("Only the owner of the group can update.");
       }
 
+=======
+>>>>>>> adding more files
       group.deleteMember(subject, false);
     } finally {
       GrouperSession.stopQuietly(grouperSession);
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public List<GroupMembership> getAllMembersForGroup(String groupId) throws GroupNotFoundException {
+=======
+  
+  public List<GroupMembership> getAllMembersForTheGroup(String groupId) throws GroupNotFoundException {
+>>>>>>> adding more files
     List<GroupMembership> groupMemberships = new ArrayList<GroupMembership>();
     GrouperSession grouperSession = null;
     try {
@@ -321,6 +434,7 @@ public class GroupServiceImpl implements GroupService {
     }
     return groupMemberships;
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public List<GroupMembership> getAllMembershipsForUser(String userId) throws SubjectNotFoundException {
     List<GroupMembership> groupMemberships = new ArrayList<GroupMembership>();
@@ -409,4 +523,56 @@ public class GroupServiceImpl implements GroupService {
 
   }
 
+=======
+  
+  public static void main(String[] args) {
+    
+    GroupServiceImpl groupServiceImpl = new GroupServiceImpl();
+    
+    // create a test group
+    Group parentGroup = new Group();
+    parentGroup.setId("airavata parent group id");
+    parentGroup.setName("airavata parent group name");
+    parentGroup.setDescription("airavata parent group description");
+    groupServiceImpl.createOrUpdateGroup(parentGroup);
+    
+    // update the same group
+    Group updateGroup = new Group();
+    updateGroup.setId("airavata parent group id");
+    updateGroup.setName("airavata parent group name updated");
+    updateGroup.setDescription("airavata parent group description updated");
+    groupServiceImpl.createOrUpdateGroup(updateGroup);
+    
+    // create another group
+    Group childGroup = new Group();
+    childGroup.setId("airavata child group id");
+    childGroup.setName("airavata child group name");
+    childGroup.setDescription("airavata child group description");
+    groupServiceImpl.createOrUpdateGroup(childGroup);
+    
+    // add child group to parent group
+    groupServiceImpl.addGroupToGroup("airavata parent group id", "airavata child group id");
+      
+    // add a direct person to the group
+    groupServiceImpl.addUserToGroup("admin@seagrid", "airavata parent group id");
+    
+    // add a person to the child group which will be basically an indirect member of parent group
+    groupServiceImpl.addUserToGroup("scnakandala@seagrid", "airavata child group id");
+    
+    // get the parent group
+    groupServiceImpl.getGroup("airavata parent group id");
+    
+    //get all the members of the group
+    groupServiceImpl.getAllMembersForTheGroup("airavata parent group id");
+    
+    // remove child from parent
+    groupServiceImpl.removeGroupFromGroup("airavata parent group id", "airavata child group id");
+    
+    // delete the same group 
+    groupServiceImpl.deleteGroup("airavata child group id");
+    groupServiceImpl.deleteGroup("airavata parent group id");
+    
+  }
+ 
+>>>>>>> adding more files
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/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 a4cc29c..fc4b33a 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
@@ -1,5 +1,9 @@
 /**
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
  *
+=======
+ * 
+>>>>>>> adding more files
  */
 package org.apache.airavata.grouper.resource;
 
@@ -16,7 +20,10 @@ 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;
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 import org.apache.airavata.grouper.AiravataGrouperUtil;
+=======
+>>>>>>> adding more files
 import org.apache.airavata.grouper.SubjectType;
 import org.apache.airavata.grouper.group.GroupServiceImpl;
 import org.apache.airavata.grouper.permission.PermissionAction;
@@ -38,6 +45,7 @@ import static org.apache.airavata.grouper.resource.ResourceType.*;
  *
  */
 public class ResourceServiceImpl {
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
 
   //TODO: break this method into smaller methods
@@ -45,11 +53,24 @@ public class ResourceServiceImpl {
 
     validateResource(resource);
 
+=======
+  
+  
+  //TODO: break this method into smaller methods
+  public void createResource(Resource resource) throws ResourceNotFoundException {
+    
+    validateResource(resource);
+    
+>>>>>>> adding more files
     GrouperSession grouperSession = null;
     try {
       grouperSession = GrouperSession.startRootSession();
       AttributeDefName parentAttributeDefName = null;
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+      
+>>>>>>> adding more files
       // make sure that the parent resource exists in grouper if it is in the request
       if (resource.getParentResourceId() != null) {
         parentAttributeDefName = AttributeDefNameFinder.findByName(resource.getResourceType().getParentResoruceType()
@@ -58,12 +79,20 @@ public class ResourceServiceImpl {
           throw new ResourceNotFoundException(resource.getParentResourceId() +" was not found.");
         }
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+      
+>>>>>>> adding more files
       Subject subject = SubjectFinder.findByIdAndSource(resource.getOwnerId(), SUBJECT_SOURCE, false);
       if (subject == null) {
         throw new IllegalArgumentException("Resource owner id "+resource.getOwnerId()+" could not be found.");
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+      
+>>>>>>> adding more files
       // create an attribute def if doesn't exist
       AttributeDef attributeDef = AttributeDefFinder.findByName(PERMISSIONS_ATTRIBUTE_DEF, false);
       if (attributeDef == null) {
@@ -75,7 +104,11 @@ public class ResourceServiceImpl {
         AttributeAssignAction write = attributeDef.getAttributeDefActionDelegate().addAction(WRITE.name());
         write.getAttributeAssignActionSetDelegate().addToAttributeAssignActionSet(read);
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+      
+>>>>>>> adding more files
       // create attribute def name
       AttributeDefNameSave attributeDefNameSave = new AttributeDefNameSave(grouperSession, attributeDef);
       attributeDefNameSave.assignCreateParentStemsIfNotExist(true);
@@ -85,16 +118,25 @@ public class ResourceServiceImpl {
       attributeDefNameSave.assignDescription(resource.getDescription());
       attributeDefNameSave.assignDisplayName(resource.getName());
       AttributeDefName attributeDefName = attributeDefNameSave.save();
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+      
+>>>>>>> adding more files
       // set the inheritance if parent attribute def name is not null
       if (parentAttributeDefName != null) {
         parentAttributeDefName.getAttributeDefNameSetDelegate().addToAttributeDefNameSet(attributeDefName);
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+      
+>>>>>>> adding more files
       RoleServiceImpl roleService = new RoleServiceImpl();
       //TODO remove the session being passed
       Group readRole = roleService.createRole(resource.getId()+"_"+READ.name(), grouperSession);
       Group writeRole = roleService.createRole(resource.getId()+"_"+WRITE.name(), grouperSession);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
       readRole.getPermissionRoleDelegate().assignRolePermission(READ.name(), attributeDefName, PermissionAllowed.ALLOWED);
       writeRole.getPermissionRoleDelegate().assignRolePermission(WRITE.name(), attributeDefName, PermissionAllowed.ALLOWED);
@@ -103,11 +145,25 @@ public class ResourceServiceImpl {
       // give the write role to ownerId
       roleService.assignRoleToUser(resource.getOwnerId(), resource.getId()+"_"+WRITE.name(), grouperSession);
 
+=======
+      
+      readRole.getPermissionRoleDelegate().assignRolePermission(READ.name(), attributeDefName, PermissionAllowed.ALLOWED);
+      writeRole.getPermissionRoleDelegate().assignRolePermission(WRITE.name(), attributeDefName, PermissionAllowed.ALLOWED);
+      writeRole.getRoleInheritanceDelegate().addRoleToInheritFromThis(readRole);
+      
+      // give the write role to ownerId
+      roleService.assignRoleToUser(resource.getOwnerId(), resource.getId()+"_"+WRITE.name(), grouperSession);
+      
+>>>>>>> adding more files
     } finally {
       GrouperSession.stopQuietly(grouperSession);
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+  
+>>>>>>> adding more files
   public void deleteResource(String resourceId, ResourceType resourceType) throws ResourceNotFoundException {
     if (resourceId == null || resourceType == null) {
       throw new IllegalArgumentException("resouceId "+resourceId+" is null or resourceType"+resourceType+" is null.");
@@ -135,7 +191,11 @@ public class ResourceServiceImpl {
       GrouperSession.stopQuietly(grouperSession);
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+  
+>>>>>>> adding more files
   public Resource getResource(String resourceId, ResourceType resourceType) throws ResourceNotFoundException {
     if (resourceId == null || resourceType == null) {
       throw new IllegalArgumentException("resouceId "+resourceId+" is null or resourceType"+resourceType+" is null.");
@@ -160,9 +220,15 @@ public class ResourceServiceImpl {
     }
     return resource;
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   /**
    *
+=======
+  
+  /**
+   * 
+>>>>>>> adding more files
    * @param userId
    * @param resourceType
    * @param actions - write or read
@@ -171,20 +237,34 @@ public class ResourceServiceImpl {
    * @return
    * @throws SubjectNotFoundException
    */
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
   public Set<Resource> getAccessibleResourcesForUser(String userId, ResourceType resourceType,
       PermissionAction action, boolean pagination, Integer pageNumber, Integer pageSize) throws SubjectNotFoundException {
 
+=======
+  public Set<Resource> getAccessibleResourcesForUser(String userId, ResourceType resourceType, 
+      PermissionAction action, boolean pagination, Integer pageNumber, Integer pageSize) throws SubjectNotFoundException {
+    
+>>>>>>> adding more files
     if (userId == null || resourceType == null || action == null) {
       throw new IllegalArgumentException("Invalid input");
     }
     if (pagination && (pageNumber < 0 || pageSize < 1)) {
       throw new IllegalArgumentException("Invalid pagination properties");
     }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
     GrouperSession grouperSession = null;
     try {
       grouperSession = GrouperSession.startRootSession();
 
+=======
+    
+    GrouperSession grouperSession = null;
+    try {
+      grouperSession = GrouperSession.startRootSession();
+      
+>>>>>>> adding more files
       PermissionFinder permissionFinder = new PermissionFinder();
       permissionFinder.addPermissionDef(PERMISSIONS_ATTRIBUTE_DEF);
       permissionFinder.addAction(action.name());
@@ -193,7 +273,11 @@ public class ResourceServiceImpl {
         throw new SubjectNotFoundException("userId "+userId+" was not found.");
       }
       permissionFinder.addSubject(subject);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+      
+>>>>>>> adding more files
       Stem stem = StemFinder.findByName(grouperSession, resourceType.getStemFromResourceType(), true);
       permissionFinder.assignPermissionNameFolder(stem);
       permissionFinder.assignPermissionNameFolderScope(Scope.ONE);
@@ -203,6 +287,7 @@ public class ResourceServiceImpl {
         permissionFinder.assignQueryOptions(queryOptions);
       }
       Set<PermissionEntry> permissions = permissionFinder.findPermissions();
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
       Set<Resource> resources = new HashSet<Resource>();
       for (PermissionEntry entry: permissions) {
@@ -225,10 +310,44 @@ public class ResourceServiceImpl {
       throw new IllegalArgumentException("Invalid input");
     }
 
+=======
+      
+      Set<Resource> resources = new HashSet<Resource>();
+      for (PermissionEntry entry: permissions) {
+        Resource resource = new Resource(entry.getAttributeDefNameDispName(), resourceType);
+        resource.setName(entry.getAttributeDefName().getDisplayExtension());
+        
+        //TODO: Discuss it with Suresh and Supun. It might cause some performance issues. We probably should not populate the parent id since caller will already have it.
+//        Set<AttributeDefName> parentAttributeDefNames = entry.getAttributeDefName().getAttributeDefNameSetDelegate().getAttributeDefNamesThatImplyThisImmediate();
+//        if (parentAttributeDefNames != null && parentAttributeDefNames.size() > 0) {
+//          resource.setParentResourceId(parentAttributeDefNames.iterator().next().getExtension());
+//        }
+        
+        resources.add(resource);
+        
+      }
+            
+      return resources;
+      
+    } finally {
+      GrouperSession.stopQuietly(grouperSession);
+    }
+    
+  }
+  
+  // action can be read or write only
+  public Set<String> getAllAccessibleUsers(String resourceId, ResourceType resourceType, PermissionAction action) {
+    
+    if (resourceId == null || resourceType == null || action == null) {
+      throw new IllegalArgumentException("Invalid input");
+    }
+    
+>>>>>>> adding more files
     GrouperSession grouperSession = null;
     Set<String> userIds = new HashSet<String>();
     try {
       grouperSession = GrouperSession.startRootSession();
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
       PermissionFinder permissionFinder = new PermissionFinder();
       permissionFinder.addPermissionDef(PERMISSIONS_ATTRIBUTE_DEF);
@@ -240,11 +359,24 @@ public class ResourceServiceImpl {
       permissionFinder.addRole(AiravataGrouperUtil.ROLES_STEM_NAME+ ":" + resourceId + "_" + action.toString());
       Set<PermissionEntry> permissions = permissionFinder.findPermissions();
 
+=======
+      
+      PermissionFinder permissionFinder = new PermissionFinder();
+      permissionFinder.addPermissionDef(PERMISSIONS_ATTRIBUTE_DEF);
+      permissionFinder.addAction(action.name());
+      
+      Stem stem = StemFinder.findByName(grouperSession, resourceType.getStemFromResourceType(), true);
+      permissionFinder.assignPermissionNameFolder(stem);
+      permissionFinder.assignPermissionNameFolderScope(Scope.ONE);
+      Set<PermissionEntry> permissions = permissionFinder.findPermissions();
+      
+>>>>>>> adding more files
       for (PermissionEntry entry: permissions) {
         if (entry.getSubjectSourceId().equals(SUBJECT_SOURCE)) {
           userIds.add(entry.getSubjectId());
         }
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
       return userIds;
 
@@ -254,6 +386,17 @@ public class ResourceServiceImpl {
 
   }
 
+=======
+            
+      return userIds;
+      
+    } finally {
+      GrouperSession.stopQuietly(grouperSession);
+    }
+        
+  }
+  
+>>>>>>> adding more files
   private void validateResource(Resource resource) {
     if (resource.getResourceType() == null) {
       throw new IllegalArgumentException("Resource type is a required field");
@@ -265,17 +408,28 @@ public class ResourceServiceImpl {
       throw new IllegalArgumentException("Resource ownerId is a required field.");
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public static void main(String[] args) {
     ResourceServiceImpl resourceService = new ResourceServiceImpl();
 
+=======
+  
+  public static void main(String[] args) {
+    ResourceServiceImpl resourceService = new ResourceServiceImpl();
+    
+>>>>>>> adding more files
     // create a Project resource
     Resource projectResource = new Resource("project resource id", PROJECT);
     projectResource.setDescription("project resource description");
     projectResource.setName("project resource name");
     projectResource.setOwnerId("airavata_id_1");
     resourceService.createResource(projectResource);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+    
+>>>>>>> adding more files
     // create an Experiment resource
     Resource experimentResource = new Resource("experiment resource id", EXPERIMENT);
     experimentResource.setDescription("experiment resource description");
@@ -283,7 +437,11 @@ public class ResourceServiceImpl {
     experimentResource.setParentResourceId("project resource id");
     experimentResource.setOwnerId("airavata_id_1");
     resourceService.createResource(experimentResource);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+    
+>>>>>>> adding more files
     //create another experiment resource within the same project resource
     Resource experimentResource1 = new Resource("experiment resource id1", ResourceType.EXPERIMENT);
     experimentResource1.setDescription("experiment resource description1");
@@ -291,7 +449,11 @@ public class ResourceServiceImpl {
     experimentResource1.setParentResourceId("project resource id");
     experimentResource1.setOwnerId("airavata_id_1");
     resourceService.createResource(experimentResource1);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+    
+>>>>>>> adding more files
     // create a data file resource
     Resource dataResource = new Resource("data resource id", ResourceType.DATA);
     dataResource.setDescription("data resource description");
@@ -299,6 +461,7 @@ public class ResourceServiceImpl {
     dataResource.setParentResourceId("experiment resource id1");
     dataResource.setOwnerId("airavata_id_1");
     resourceService.createResource(dataResource);
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
     // get the experiment resource and it should have parent set to project
     Resource resource = resourceService.getResource("experiment resource id1", EXPERIMENT);
@@ -315,11 +478,31 @@ public class ResourceServiceImpl {
     // create a group of users
     GroupServiceImpl groupService = new GroupServiceImpl();
     org.apache.airavata.grouper.group.Group group = new org.apache.airavata.grouper.group.Group("airavata test group id", "airavata_id_1");
+=======
+    
+    // get the experiment resource and it should have parent set to project
+    Resource resource = resourceService.getResource("experiment resource id1", EXPERIMENT);
+    System.out.println(resource);
+    
+    Set<Resource> accessibleResourcesForUser = resourceService.getAccessibleResourcesForUser("airavata_id_1", EXPERIMENT, WRITE, true, 1, 2);
+    System.out.println("accessible resources on page 1 are "+accessibleResourcesForUser.size());
+    
+    
+    //share the experiment with airavata_id_2
+    PermissionServiceImpl permissionService = new PermissionServiceImpl();
+    permissionService.grantPermission("airavata_id_2", SubjectType.PERSON, "experiment resource id1", EXPERIMENT, WRITE);
+    
+    // create a group of users
+    GroupServiceImpl groupService = new GroupServiceImpl();
+    org.apache.airavata.grouper.group.Group group = new org.apache.airavata.grouper.group.Group();
+    group.setId("airavata test group id");
+>>>>>>> adding more files
     group.setName("airavata test group name");
     group.setDescription("airavata test group description");
     List<String> members = new ArrayList<String>();
     members.add("airavata_id_3");
     members.add("airavata_id_4");
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
     group.setMembers(members);
     groupService.createGroup(group);
 
@@ -333,6 +516,21 @@ public class ResourceServiceImpl {
     accessibleResourcesForUser = resourceService.getAccessibleResourcesForUser("airavata_id_1", EXPERIMENT, READ, false, 1, 2);
     System.out.println("accessible resources without pagination are "+accessibleResourcesForUser.size());
 
+=======
+    group.setUsers(members);
+    groupService.createOrUpdateGroup(group);
+    
+    // now share the same experiment with this group as well
+    permissionService.grantPermission("airavata test group id", SubjectType.GROUP, "experiment resource id1", EXPERIMENT, READ);
+    
+    accessibleResourcesForUser = resourceService.getAccessibleResourcesForUser("airavata_id_3", EXPERIMENT, READ, true, 1, 2);
+    System.out.println("accessible resources on page 1 are "+accessibleResourcesForUser.size());
+    
+    // get all resources, or no pagination
+    accessibleResourcesForUser = resourceService.getAccessibleResourcesForUser("airavata_id_1", EXPERIMENT, READ, false, 1, 2);
+    System.out.println("accessible resources without pagination are "+accessibleResourcesForUser.size());
+    
+>>>>>>> adding more files
     Set<String> allAccessibleUsers = resourceService.getAllAccessibleUsers("experiment resource id1", EXPERIMENT, READ);
     System.out.println("users who have read access on experiment resource id1 are "+allAccessibleUsers);
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/modules/group-manager/src/main/java/org/apache/airavata/grouper/role/RoleServiceImpl.java
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/java/org/apache/airavata/grouper/role/RoleServiceImpl.java b/modules/group-manager/src/main/java/org/apache/airavata/grouper/role/RoleServiceImpl.java
index 558d68c..0351e35 100755
--- a/modules/group-manager/src/main/java/org/apache/airavata/grouper/role/RoleServiceImpl.java
+++ b/modules/group-manager/src/main/java/org/apache/airavata/grouper/role/RoleServiceImpl.java
@@ -1,5 +1,9 @@
 /**
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
  *
+=======
+ * 
+>>>>>>> adding more files
  */
 package org.apache.airavata.grouper.role;
 
@@ -17,10 +21,17 @@ import static org.apache.airavata.grouper.AiravataGrouperUtil.*;
  *
  */
 public class RoleServiceImpl {
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
 
   public Group createRole(String roleId, GrouperSession session) {
 
+=======
+  
+  
+  public Group createRole(String roleId, GrouperSession session) {
+    
+>>>>>>> adding more files
     GrouperSession grouperSession = null;
     Group role = null;
     try {
@@ -41,7 +52,11 @@ public class RoleServiceImpl {
     }
     return role;
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
+=======
+  
+>>>>>>> adding more files
   public void deleteRole(String roleId, GrouperSession session) {
     GrouperSession grouperSession = null;
     try {
@@ -56,9 +71,15 @@ public class RoleServiceImpl {
       }
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public void assignRoleToUser(String userId, String roleId, GrouperSession session) throws GroupNotFoundException, SubjectNotFoundException {
 
+=======
+  
+  public void assignRoleToUser(String userId, String roleId, GrouperSession session) throws GroupNotFoundException, SubjectNotFoundException {
+    
+>>>>>>> adding more files
     GrouperSession grouperSession = null;
     try {
       grouperSession = session != null? session : GrouperSession.startRootSession();
@@ -66,7 +87,11 @@ public class RoleServiceImpl {
       if (role == null) {
         throw new GroupNotFoundException("Role "+roleId+" was not found.");
       }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
       Subject subject = SubjectFinder.findById(userId, false);
+=======
+      Subject subject = SubjectFinder.findByIdAndSource(userId, SUBJECT_SOURCE, false);
+>>>>>>> adding more files
       if (subject == null) {
         throw new SubjectNotFoundException("userId "+userId+" was not found.");
       }
@@ -76,9 +101,15 @@ public class RoleServiceImpl {
         GrouperSession.stopQuietly(grouperSession);
       }
     }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   }
 
+=======
+    
+  }
+  
+>>>>>>> adding more files
   public void removeRoleFromUser(String userId, String roleId, GrouperSession session) throws GroupNotFoundException, SubjectNotFoundException {
     GrouperSession grouperSession = null;
     try {
@@ -98,6 +129,7 @@ public class RoleServiceImpl {
       }
     }
   }
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 
   public static void main(String[] args) {
     RoleServiceImpl roleServiceImpl = new RoleServiceImpl();
@@ -106,6 +138,16 @@ public class RoleServiceImpl {
 
     roleServiceImpl.assignRoleToUser("test.subject.3", "test_role", null);
 
+=======
+  
+  public static void main(String[] args) {
+    RoleServiceImpl roleServiceImpl = new RoleServiceImpl();
+    
+    roleServiceImpl.createRole("test_role", null);
+    
+    roleServiceImpl.assignRoleToUser("test.subject.3", "test_role", null);
+    
+>>>>>>> adding more files
     //roleServiceImpl.deleteRole("test_role", null);
   }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/modules/group-manager/src/main/resources/grouper.hibernate.properties
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/resources/grouper.hibernate.properties b/modules/group-manager/src/main/resources/grouper.hibernate.properties
index d119c3f..1621d92 100755
--- a/modules/group-manager/src/main/resources/grouper.hibernate.properties
+++ b/modules/group-manager/src/main/resources/grouper.hibernate.properties
@@ -1,3 +1,4 @@
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
 hibernate.connection.url = jdbc:mysql://localhost:3306/grouper
 
 hibernate.connection.username         =root
@@ -5,6 +6,15 @@ hibernate.connection.username         =root
 # Java and Ant you may need to specify a password of "".
 # Note: you can keep passwords external and encrypted: https://bugs.internet2.edu/jira/browse/GRP-122
 hibernate.connection.password         =
+=======
+hibernate.connection.url = jdbc:mysql://gw62.iu.xsede.org:3306/grouper
+
+hibernate.connection.username         =airavata_grouper_client
+# If you are using an empty password, depending upon your version of
+# Java and Ant you may need to specify a password of "".
+# Note: you can keep passwords external and encrypted: https://bugs.internet2.edu/jira/browse/GRP-122
+hibernate.connection.password         =airavata_grouper_client
+>>>>>>> adding more files
 
 hibernate.cache.use_second_level_cache=true
 hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/8c0cd2ec/modules/group-manager/src/main/resources/sources.xml
----------------------------------------------------------------------
diff --git a/modules/group-manager/src/main/resources/sources.xml b/modules/group-manager/src/main/resources/sources.xml
index b00ad26..6107d7d 100755
--- a/modules/group-manager/src/main/resources/sources.xml
+++ b/modules/group-manager/src/main/resources/sources.xml
@@ -770,12 +770,20 @@ where
         
         <init-param>
             <param-name>dbUser</param-name>
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
             <param-value></param-value>
+=======
+            <param-value>airavata_grouper_client</param-value>
+>>>>>>> adding more files
         </init-param>
         
         <init-param>
             <param-name>dbPwd</param-name>
+<<<<<<< 10f30a96f6478fb045ae6e0cdb15b25614581856
             <param-value></param-value>
+=======
+            <param-value>airavata_grouper_client</param-value>
+>>>>>>> adding more files
         </init-param>
     
          <init-param>


Mime
View raw message