This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch gc/8573
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 62eba6dc3c91001cdd39f64bf5c37fa02060ccf8
Author: Guillermo Cruz <[email protected]>
AuthorDate: Thu Jan 9 13:06:38 2025 -0700

    [#8573] hide admin/update/create permissions for authorized and anonymous 
users
---
 .../allura/ext/admin/templates/project_groups.html  | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/Allura/allura/ext/admin/templates/project_groups.html 
b/Allura/allura/ext/admin/templates/project_groups.html
index ed941dd9d..3a10e9042 100644
--- a/Allura/allura/ext/admin/templates/project_groups.html
+++ b/Allura/allura/ext/admin/templates/project_groups.html
@@ -31,13 +31,20 @@
 {% macro show_perms_for_role(role) %}
   <ul class="permissions">
     {% for perm in permissions_by_role[role._id.__str__()] %}
-    {% if private_projects or (not private_projects and perm['name'] != 
'read') or (not private_projects and perm['name'] == 'read') and perm['has'] == 
'no' %}
-    <li class="{{perm['has']}}" data-permission="{{perm['name']}}">
-      {{ g.icons['perm_has_%s'%perm['has']].render(title=perm['text'], 
closing_tag=False) }}
-        {{perm['name']}}
-      </a> {# close tag, opened by render #}
-    </li>
-    {% endif %}
+        {%  set is_auth_or_anon = role.name not in ['Admin', 'Developer', 
'Member'] %}
+        {% if (private_projects and not is_auth_or_anon) or (not 
private_projects and perm['name'] != 'read' and not is_auth_or_anon) or (not 
private_projects and perm['name'] == 'read' and not is_auth_or_anon) and 
perm['has'] == 'no'  %}
+            <li class="{{perm['has']}}" data-permission="{{perm['name']}}">
+              {{ g.icons['perm_has_%s'%perm['has']].render(title=perm['text'], 
closing_tag=False) }}
+                {{perm['name']}}
+              </a> {# close tag, opened by render #}
+            </li>
+        {% elif is_auth_or_anon and perm['name'] == 'read' %}
+            <li class="{{perm['has']}}" data-permission="{{perm['name']}}">
+              {{ g.icons['perm_has_%s'%perm['has']].render(title=perm['text'], 
closing_tag=False) }}
+                {{perm['name']}}
+              </a> {# close tag, opened by render #}
+            </li>
+        {% endif %}
     {% endfor %}
   </ul>
 {% endmacro %}

Reply via email to