1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-28 16:08:25 +00:00
seahub/organizations/utils.py
2012-08-02 21:49:17 +08:00

14 lines
345 B
Python

import sys
from seaserv import get_org_id_by_repo_id
def access_org_repo(request, repo_id):
"""
Check whether user can view org repo.
"""
if not request.user.org:
return False
cur_org_id = request.user.org['org_id']
org_id = get_org_id_by_repo_id(repo_id)
return True if cur_org_id == org_id else False