Skip to content

Commit

Permalink
Merge pull request #2834 from tvdeyen/fix-clipboard-button-permissions
Browse files Browse the repository at this point in the history
Fix elements clipboard button permissions
  • Loading branch information
tvdeyen authored Apr 11, 2024
2 parents 621382e + 11a4df5 commit 3ceaff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/elements/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
link_options: {
id: "clipboard_button"
},
if_permitted_to: [:show, :alchemy_clipboard]
if_permitted_to: [:index, :alchemy_admin_clipboard]
) %>
<sl-tooltip content="<%= Alchemy.t("Collapse all elements") %>" placement="top-end" class="right">
<button id="collapse-all-elements-button" class="icon_button">
Expand Down
7 changes: 7 additions & 0 deletions spec/features/admin/edit_elements_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
authorize_user(:as_editor)
end

context "The elements window" do
it "shows a clipboard button" do
visit alchemy.admin_elements_path(page_version_id: a_page.draft_version.id)
expect(page).to have_selector("#clipboard_button")
end
end

context "Visiting the new element form" do
context "with a page_version_id passed" do
scenario "a form to select a new element for the page appears." do
Expand Down

0 comments on commit 3ceaff0

Please sign in to comment.