コード例 #1
0
    def org_get_shared_users_by_repo(self, org_id, repo_id):
        users = []
        # get users that the repo is shared to
        shared_users = syncwserv_threaded_rpc.org_get_shared_users_by_repo(org_id, repo_id)
        for user in shared_users:
            users.append(user.user)

        # get users in groups that the repo is shared to
        group_ids = syncwserv_threaded_rpc.get_org_groups_by_repo(org_id, repo_id)
        if not group_ids:
            return users

        ids = []
        for group_id in group_ids.split('\n'):
            if not group_id:
                continue
            ids.append(int(group_id))

        json_ids = json.dumps(ids)
        group_users = ccnet_threaded_rpc.get_groups_members(json_ids)

        for user in group_users:
            if user.user_name not in users:
                users.append(user.user_name)

        return users
コード例 #2
0
 def get_groups_members(self, group_ids):
     """
     @group_ids: json '[id1, id2, id3,...]'
     """
     return ccnet_threaded_rpc.get_groups_members(group_ids)