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

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new d30ac0e  Hide project options from users that cannot use them
d30ac0e is described below

commit d30ac0eba8dd6aeaeeb1abf552290455c0309242
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Dec 29 16:06:10 2025 +0000

    Hide project options from users that cannot use them
---
 atr/get/projects.py                    | 4 ++--
 atr/templates/committee-directory.html | 2 +-
 atr/templates/index-committer.html     | 8 +++++---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/atr/get/projects.py b/atr/get/projects.py
index e0d7485..0f240a8 100644
--- a/atr/get/projects.py
+++ b/atr/get/projects.py
@@ -195,8 +195,8 @@ async def view(session: web.Committer, name: str) -> 
web.WerkzeugResponse | str:
         if project.created_by == session.uid:
             page.append(_render_delete_section(project))
 
-        if is_committee_member or is_privileged:
-            if project.committee:
+        if project.committee:
+            if (project.committee.name in session.committees) or is_privileged:
                 page.p[
                     htm.a(
                         ".btn.btn-sm.btn-outline-primary",
diff --git a/atr/templates/committee-directory.html 
b/atr/templates/committee-directory.html
index f0c7dfb..8dba8e6 100644
--- a/atr/templates/committee-directory.html
+++ b/atr/templates/committee-directory.html
@@ -152,7 +152,7 @@
                 {# Add an else clause here if we decide to show an alternative 
to an empty card #}
                         {% endif %}
                     </div>
-                    {% if current_user and is_part and (not 
committee_is_standing(committee.name)) %}
+                    {% if current_user and (committee.name in 
current_user.committees) and (not committee_is_standing(committee.name)) %}
                         <a href="{{ as_url(get.projects.add_project, 
committee_name=committee.name) }}"
                            title="Create a project for {{ 
committee.display_name }}"
                            class="text-decoration-none d-block mt-4 mb-3">
diff --git a/atr/templates/index-committer.html 
b/atr/templates/index-committer.html
index 2011d4e..021c98c 100644
--- a/atr/templates/index-committer.html
+++ b/atr/templates/index-committer.html
@@ -89,9 +89,11 @@
         <p class="mb-3">
           <a href="{{ as_url(get.projects.view, name=project.name) }}"
              class="text-decoration-none me-2">About this project</a>
-          <span class="text-muted me-2">/</span>
-          <a href="{{ as_url(get.projects.add_project, 
committee_name=project.committee.name) }}"
-             class="text-decoration-none me-2">Create a sibling project</a>
+          {% if project.committee.name in current_user.committees %}
+            <span class="text-muted me-2">/</span>
+            <a href="{{ as_url(get.projects.add_project, 
committee_name=project.committee.name) }}"
+               class="text-decoration-none me-2">Create a sibling project</a>
+          {% endif %}
           {% if completed_releases %}
             <span class="text-muted me-2">/</span>
             <a href="{{ as_url(get.release.finished, 
project_name=project.name) }}"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to