1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-23 20:37:42 +00:00

[repo] get perm when list repo dir/file list

This commit is contained in:
lian
2015-04-03 14:05:31 +08:00
parent 8f57cd1b24
commit b6e9f2004f
7 changed files with 101 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ from seahub.notifications.views import add_notice_from_info
from seahub.message.models import UserMessage
from seahub.share.models import UploadLinkShare
from seahub.signals import upload_file_successful, repo_created, repo_deleted
from seahub.views import get_repo_dirents, validate_owner, \
from seahub.views import get_repo_dirents_with_perm, validate_owner, \
check_repo_access_permission, get_unencry_rw_repos_by_user, \
get_system_default_repo_id, get_diff, group_events_data, \
get_owned_repo_list, check_folder_permission
@@ -273,7 +273,9 @@ def list_dir(request, repo_id):
path = path + '/'
more_start = None
file_list, dir_list, dirent_more = get_repo_dirents(request, repo, head_commit, path, offset=0, limit=100)
file_list, dir_list, dirent_more = get_repo_dirents_with_perm(request, repo,
head_commit, path,
offset=0, limit=100)
if dirent_more:
more_start = 100
zipped = get_nav_path(path, repo.name)
@@ -365,7 +367,9 @@ def list_dir_more(request, repo_id):
return HttpResponse(json.dumps({'error': err_msg}),
status=400, content_type=content_type)
more_start = None
file_list, dir_list, dirent_more = get_repo_dirents(request, repo, head_commit, path, offset, limit=100)
file_list, dir_list, dirent_more = get_repo_dirents_with_perm(request, repo,
head_commit, path,
offset, limit=100)
if dirent_more:
more_start = offset + 100