From a9a424ffbeea0b5a5a350439058ffaced11b2848 Mon Sep 17 00:00:00 2001 From: aaronskiba Date: Mon, 29 Jul 2024 13:55:22 -0600 Subject: [PATCH] Add conditional for who can add plan contributors Prior to this commit, even plan collaborators with "Read only" access could add/edit plan contributors. --- app/views/contributors/index.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/contributors/index.html.erb b/app/views/contributors/index.html.erb index ddd3911313..3a6df98745 100644 --- a/app/views/contributors/index.html.erb +++ b/app/views/contributors/index.html.erb @@ -29,8 +29,10 @@

<%= _("No contributors have been defined.") %>

<% end %> - <%= link_to _("Add a contributor"), new_plan_contributor_path(@plan), - class: "btn btn-primary" %> + <% if @plan.editable_by?(current_user.id) %> + <%= link_to _("Add a contributor"), new_plan_contributor_path(@plan), + class: "btn btn-primary" %> + <% end %> <% end %>