1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-28 08:06:56 +00:00

update unshare public repo api

system admin can also ushare a public repo
This commit is contained in:
lian
2018-12-20 16:36:14 +08:00
parent c2a32d1aca
commit 0eabacf35f

View File

@@ -220,7 +220,7 @@ class SharedRepo(APIView):
""" Unshare a repo.
Permission checking:
1. Only repo owner can unshare a library.
1. Only repo owner and system admin can unshare a publib library.
"""
# argument check
@@ -245,7 +245,7 @@ class SharedRepo(APIView):
else:
repo_owner = seafile_api.get_repo_owner(repo_id)
if username != repo_owner:
if not request.user.is_staff and not username == repo_owner:
error_msg = 'Permission denied.'
return api_error(status.HTTP_403_FORBIDDEN, error_msg)