You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/06/20 20:25:37 UTC

[16/18] airavata git commit: adding initial version of the group manager data models and CPI

adding initial version of the group manager data models and CPI


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

Branch: refs/heads/develop
Commit: 361357e8d816d68c0ae707620ee73cfe9eb58c8e
Parents: 75a87bb
Author: scnakandala <su...@gmail.com>
Authored: Mon Jun 20 16:23:17 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Mon Jun 20 16:23:17 2016 -0400

----------------------------------------------------------------------
 .../user-group-models/group_manager_cpi.thrift  | 95 ++++++++++++++++++++
 .../group_manager_model.thrift                  | 93 +++++++++++++++++++
 2 files changed, 188 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/361357e8/thrift-interface-descriptions/data-models/user-group-models/group_manager_cpi.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/user-group-models/group_manager_cpi.thrift b/thrift-interface-descriptions/data-models/user-group-models/group_manager_cpi.thrift
new file mode 100644
index 0000000..5b17fcd
--- /dev/null
+++ b/thrift-interface-descriptions/data-models/user-group-models/group_manager_cpi.thrift
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+include "./group_manager_model.thrift"
+
+namespace java org.apache.airavata.group.cpi
+
+service GroupManagerService {
+
+    /**
+     * Resources related API methods
+    **/
+    string registerResource(group_manager_model.Resource  resource);
+
+    bool updateResource(group_manager_model.Resource  resource);
+
+    bool deleteResource(string resourceId);
+
+    group_manager_model.Resource getResource(string resourceId);
+
+
+    /**
+     * Users related API methods
+    **/
+    bool registerUser(group_manager_model.User user);
+
+    bool updateUser(group_manager_model.User user);
+
+    bool deleteUser(string grouperUserId);
+
+    group_manager_model.User getUser(string grouperUserId);
+
+    bool assignUserToGroup(string grouperUserId, string groupId);
+
+    bool removeUserFromGroup(string grouperUserId, string groupId);
+
+    list<group_manager_model.GroupMembership> getAllGroupMembershipsForUser(string grouperUserId);
+
+
+    /**
+     * Groups related API methods
+    **/
+    string registerGroup(group_manager_model.Group group);
+
+    bool updateGroup(group_manager_model.Group group);
+
+    bool deleteGroup(string groupId);
+
+    group_manager_model.Group getGroup(string groupdId);
+
+    bool addGroupToGroup(string parentGroupId, string childGroupId);
+
+    bool removeGroupFromGroup(string parentGroupId, string childGroupId);
+
+    list<group_manager_model.GroupMembership> getAllMembersForTheGroup(string groupId);
+
+
+    /**
+     * Grant Revoke Permissions API methods
+    **/
+    bool grantPermissions(string subjectId, group_manager_model.SubjectType subjectType, string resourceId,
+        list<group_manager_model.ResourcePermissionType> grantPermissions, bool recursively)
+
+    bool revokePermissions(string subjectId, group_manager_model.SubjectType subjectType, string resourceId,
+            list<group_manager_model.ResourcePermissionType> revokePermissiones,bool recursively)
+
+    bool revokeAllPermissions(string subjectId, group_manager_model.SubjectType subjectType, string resourceId, bool recursively)
+
+
+    /**
+     * Browse and Search Related API method
+    **/
+    list<group_manager_model.Resource> getAccessibleResourcesForUser(string grouperUserId, group_manager_model.ResourceType resourceType,
+            list<group_manager_model.ResourcePermissionType> permissions, i32 offset, i32 limit)
+
+    list<group_manager_model.Resource> searcgAccessibleResourcesForUser(string grouperUserId, group_manager_model.ResourceType resourceType,
+                list<group_manager_model.ResourcePermissionType> permissions, map<string,string> filters, i32 offset, i32 limit)
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/361357e8/thrift-interface-descriptions/data-models/user-group-models/group_manager_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/user-group-models/group_manager_model.thrift b/thrift-interface-descriptions/data-models/user-group-models/group_manager_model.thrift
new file mode 100644
index 0000000..7783841
--- /dev/null
+++ b/thrift-interface-descriptions/data-models/user-group-models/group_manager_model.thrift
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+ include "../../airavata-apis/airavata_commons.thrift"
+
+ namespace java org.apache.airavata.model.group
+ namespace php Airavata.Model.Group
+ namespace cpp apache.airavata.model.group
+ namespace py apache.airavata.model.group
+
+const string GROUP_MANAGER_VERSION = "1.0"
+
+
+enum ResourceType {
+    PROJECT,
+    EXPERIMENT,
+    FILE,
+    OTHER
+}
+
+enum ResourcePermissionType {
+    READ_WRITE
+    READ_ONLY,
+    WRITE_WRITE_ONLY
+}
+
+struct Resource {
+    1: required string resourceId = airavata_commons.DEFAULT_ID,
+    2: required string resourceName,
+    3: required ResourceType resourceType,
+    4: required string ownerId,
+    5: optional string resourceDescription,
+    6: optional i64 createdTime,
+    7: optional i64 lastModifiedTime,
+    8: optional string parentResourceId,
+    9: optional list<Resource> childResources,
+    10: optional map<string,string> metadata
+}
+
+struct Group{
+    1: required string groupId = airavata_commons.DEFAULT_ID,
+    2: required string groupName,
+    3: optional string description,
+    4: optional list<User> directGroupMemberUsers,
+    5: optional list<Group> directGroupMemeberGroups,
+    6: optional list<User> indirectGroupMemeberUsers,
+    7: optional list<Group> indirectGroupMemeberGroups
+    8: optional map<string,string> metadata
+}
+
+struct User {
+    1: required string grouperUserId = airavata_commons.DEFAULT_ID,
+    2: required string airavataUserId,
+    3: required string userName,
+    4: required string gatewayId
+    5: optional map<string,string> metadata
+}
+
+enum SubjectType {
+    USER,
+    GROUP
+}
+
+enum GroupMembershipType {
+    DIRECT,
+    INDIRECT
+}
+
+struct GroupMembership{
+    1: required string parentSubjectId,
+    2: required string childSubjectId,
+    3: required SubjectType childSubjectType,
+    4: required string parentSubjectName,
+    5: required string childSubjectName,
+    6: required GroupMembershipType groupMembershipType
+}
\ No newline at end of file