Skip to content

Commit

Permalink
policy check not reliant on presence in db
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamelers committed Dec 16, 2024
1 parent 13bd78b commit e455079
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/stash_engine/journal_admin/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= submit_tag('Search', name: nil, class: 'o-button__plain-text2' ) %>
</div>
<% end %>
<% if policy(@journals.first).new? %>
<% if policy([:stash_engine, :journal]).new? %>
<%= form_with(url: journal_new_path, method: :get, local: false, html: {style: "margin-left: auto"}) do %>
<button class="o-button__plain-text7"><i class="fa fa-plus" aria-hidden="true"></i> Add new</button>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= submit_tag('Search', name: nil, class: 'o-button__plain-text2' ) %>
</div>
<% end %>
<% if policy(@orgs.first).new? %>
<% if policy([:stash_engine, :journal_organization]).new? %>
<%= form_with(url: publisher_new_path, method: :get, local: false, html: {style: "margin-left: auto"}) do %>
<button class="o-button__plain-text7"><i class="fa fa-plus" aria-hidden="true"></i> Add new</button>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/stash_engine/tenant_admin/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= submit_tag('Search', name: nil, class: 'o-button__plain-text2' ) %>
</div>
<% end %>
<% if policy(@tenants.first).new? %>
<% if policy([:stash_engine, :tenant]).new? %>
<%= form_with(url: tenant_new_path, method: :get, local: false, html: {style: "margin-left: auto"}) do %>
<button class="o-button__plain-text7"><i class="fa fa-plus" aria-hidden="true"></i> Add new</button>
<% end %>
Expand Down

0 comments on commit e455079

Please sign in to comment.