1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-29 16:37:56 +00:00
seahub/organizations/utils.py

15 lines
379 B
Python
Raw Normal View History

2012-07-26 09:08:31 +00:00
import sys
2012-07-30 02:25:46 +00:00
from seaserv import get_org_id_by_repo_id
2012-07-30 02:25:46 +00:00
def access_org_repo(request, repo_id):
"""
Check whether user can view org repo.
Arguments:
- `request`: request must has org dict.
- `repo_id`: repo id
"""
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