X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/cf265108541da0a0f54e2b4517ce9441e8ccf795..c6b7810b77a7b84da1114ddfd424357496bcab9f:/apps/api/handlers/library_handlers.py diff --git a/apps/api/handlers/library_handlers.py b/apps/api/handlers/library_handlers.py index f7d57849..6ac0ba13 100644 --- a/apps/api/handlers/library_handlers.py +++ b/apps/api/handlers/library_handlers.py @@ -42,14 +42,14 @@ def check_user(request, user): log.info("user: %r, perm: %r" % (request.user, request.user.get_all_permissions()) ) #pull request if is_prq(user): - if not request.user.has_perm('api.pullrequest.can_view'): + if not request.user.has_perm('api.view_prq'): yield response.AccessDenied().django_response({ 'reason': 'access-denied', 'message': "You don't have enough priviliges to view pull requests." }) # other users elif request.user.username != user: - if not request.user.has_perm('api.document.can_view_other'): + if not request.user.has_perm('api.view_other_document'): yield response.AccessDenied().django_response({ 'reason': 'access-denied', 'message': "You don't have enough priviliges to view other people's document." @@ -337,7 +337,7 @@ class DocumentGalleryHandler(BaseHandler): gallery = {'name': assoc.name, 'pages': []} - for file in sorted(os.listdir(dirpath)): + for file in os.listdir(dirpath): if not isinstance(file, unicode): try: file = file.decode('utf-8') @@ -363,7 +363,7 @@ class DocumentGalleryHandler(BaseHandler): # gallery['pages'].sort() galleries.append(gallery) - return galleries + return galleries # # Document Text View @@ -648,7 +648,7 @@ class MergeHandler(BaseHandler): "message": "There are unresolved conflicts in your file. Fix them, and try again." }) - if not request.user.has_perm('api.document.can_share'): + if not request.user.has_perm('api.share_document'): # User is not permitted to make a merge, right away # So we instead create a pull request in the database try: