Skip to content

Commit

Permalink
Add list_org_inner_pub_repos() to seafile_api.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihaikuo committed Jun 1, 2018
1 parent 3a18498 commit 0197c7b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/seaserv/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,21 @@ def get_shared_users_by_repo(self, repo_id):
def org_get_shared_users_by_repo(self, org_id, repo_id):
return seafserv_threaded_rpc.org_get_shared_users_by_repo(org_id, repo_id)

def list_org_inner_pub_repos(self, org_id, username, start=None, limit=None):
"""
List org inner pub repos, which can be access by all org members.
"""
try:
shared_repos = seafserv_threaded_rpc.list_org_inner_pub_repos(org_id)
for repo in shared_repos:
repo.user_perm = seafserv_threaded_rpc.check_permission(repo.id, username)
except SearpcError:
shared_repos = []

# sort repos by last modify time
shared_repos.sort(lambda x, y: cmp(y.last_modified, x.last_modified))
return shared_repos

seafile_api = SeafileAPI()

class CcnetAPI(object):
Expand Down

0 comments on commit 0197c7b

Please sign in to comment.