allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject allura git commit: Show wiki edit link & login prompt, based on actual perms, not just whether user is logged in
Date Fri, 20 Apr 2018 14:11:02 GMT
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 <dave@brondsema.net>
Authored: Mon Apr 16 17:45:31 2018 -0400
Committer: Dave Brondsema <dave@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') }}


Mime
View raw message