Skip to content

Commit

Permalink
Add conditional for who can add plan contributors
Browse files Browse the repository at this point in the history
Prior to this commit, even plan collaborators with "Read only" access could add/edit plan contributors.
  • Loading branch information
aaronskiba committed Jul 29, 2024
1 parent 56759df commit a9a424f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/views/contributors/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
<p><%= _("No contributors have been defined.") %></p>
<% 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 %>
</div>
</div>
<% end %>
Expand Down

0 comments on commit a9a424f

Please sign in to comment.