Creating a default everyone group when adding a new gateway
MODIFY
airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -299,6 +299,20 @@ public class AiravataServerHandler implements Airavata.Iface {
permissionType.setDescription("Write permission type");
sharingClient.createPermissionType(permissionType);
+ //Create an "everyone" group for the domain
+ String groupId = "everyone@" + domain.domainId;
+ UserGroup userGroup = new UserGroup();
+ userGroup.setGroupId(groupId);
+ userGroup.setDomainId(domain.domainId);
+ userGroup.setGroupCardinality(GroupCardinality.MULTI_USER);
+ userGroup.setCreatedTime(System.currentTimeMillis());
+ userGroup.setUpdatedTime(System.currentTimeMillis());
+ userGroup.setOwnerId(authzToken.getClaimsMap().get(Constants.USER_NAME));
+ userGroup.setName("everyone");
+ userGroup.setDescription("Default Group");
+ userGroup.setGroupType(GroupType.DOMAIN_LEVEL_GROUP);
+ sharingClient.createGroup(userGroup);
+
registryClientPool.returnResource(registryClient);
sharingClientPool.returnResource(sharingClient);

MODIFY
modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java
@@ -164,6 +164,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac
userGroup.setGroupCardinality(GroupCardinality.SINGLE_USER);
(new UserGroupRepository()).create(userGroup);
+ // Add user to the domain's "everyone" group
String groupId = "everyone@" + user.domainId;
addUsersToGroup(user.domainId, Arrays.asList(user.userId), groupId);

Creating a default everyone group when adding a new gateway