Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(any|t)wikidraw: check write permissions early #9

Merged
merged 1 commit into from Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions MoinMoin/action/anywikidraw.py
Expand Up @@ -139,6 +139,9 @@ def render(self):
target = self.target
if not request.user.may.read(pagename):
return _('You are not allowed to view attachments of this page.')
if not request.user.may.write(pagename):
# note: "recycled" a already existing translated string, so we do not need a new string:
return _('You are not allowed to save a drawing on this page.')
if not target:
return _("Empty target name given.")

Expand Down
3 changes: 3 additions & 0 deletions MoinMoin/action/twikidraw.py
Expand Up @@ -159,6 +159,9 @@ def render(self):
target = self.target
if not request.user.may.read(pagename):
return _('You are not allowed to view attachments of this page.')
if not request.user.may.write(pagename):
# note: "recycled" a already existing translated string, so we do not need a new string:
return _('You are not allowed to save a drawing on this page.')
if not target:
return _("Empty target name given.")

Expand Down