You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2018/04/20 14:11:02 UTC
allura git commit: Show wiki edit link & login prompt,
based on actual perms, not just whether user is logged in
Repository: allura
Updated Branches:
refs/heads/master 6eb39f5e2 -> dff43b269
Show wiki edit link & login prompt, based on actual perms, not just whether user is logged in
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/dff43b26
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/dff43b26
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/dff43b26
Branch: refs/heads/master
Commit: dff43b2691d39c297c469da3ede7e9e8faa1b1bc
Parents: 6eb39f5
Author: Dave Brondsema <da...@brondsema.net>
Authored: Mon Apr 16 17:45:31 2018 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Mon Apr 16 17:45:31 2018 -0400
----------------------------------------------------------------------
ForgeWiki/forgewiki/templates/wiki/page_view.html | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/dff43b26/ForgeWiki/forgewiki/templates/wiki/page_view.html
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/templates/wiki/page_view.html b/ForgeWiki/forgewiki/templates/wiki/page_view.html
index 1b42dc2..b4d3f8a 100644
--- a/ForgeWiki/forgewiki/templates/wiki/page_view.html
+++ b/ForgeWiki/forgewiki/templates/wiki/page_view.html
@@ -41,9 +41,11 @@
{% block actions %}
{% if not page['deleted'] %}
- {% if c.user and c.user != c.user.anonymous() %}
- {{ g.icons['edit'].render(href='edit', show_title=True) }}
- {% endif %}
+ {% if h.has_access(page, 'edit') %}
+ {{ g.icons['edit'].render(href='edit', show_title=True) }}
+ {% elif c.user.is_anonymous() and h.is_allowed_by_role(page, 'edit', '*authenticated', c.project) %}
+ <a href="{{ tg.config.get('auth.login_url', '/auth/') }}">Log in to Edit</a>
+ {% endif %}
{{ g.icons['history'].render(href='history') }}
{% elif h.has_access(page, 'delete')() %}
{{ g.icons['undelete'].render(extra_css='post-link') }}