Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access control hot fix #5060

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions app/views/admin/access_controls/_table.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@
%tbody
- @access_controls.each do |acl|
%tr
%td= link_to_if can_edit_users? && !acl.user_group.system?, acl.user_group.name, edit_admin_user_group_path(acl.user_group), target: :_blank
%td= link_to_if can_edit_roles? && !acl.role.system?, acl.role.name, edit_admin_role_path(acl.role), target: :_blank
%td= link_to_if can_edit_collections? && !acl.collection.system?, acl.collection.name, edit_admin_collection_path(acl.collection), target: :_blank
%td
- if acl.user_group
= link_to_if can_edit_users? && !acl.user_group.system?, acl.user_group.name, edit_admin_user_group_path(acl.user_group), target: :_blank
%td
- if acl.role
= link_to_if can_edit_roles? && !acl.role.system?, acl.role.name, edit_admin_role_path(acl.role), target: :_blank
%td
- if acl.collection
= link_to_if can_edit_collections? && !acl.collection.system?, acl.collection.name, edit_admin_collection_path(acl.collection), target: :_blank

%td.nobr
-# Don't let use delete or edit a fully system Access Control
Expand All @@ -29,7 +35,7 @@
%span.icon-pencil
Edit Access Control List

= link_to admin_access_control_path(acl), method: :delete, data: {confirm: "Would you really like to delete the access control for collection '#{acl.collection.name}', role '#{acl.role.name}', and user group #{acl.user_group.name}?"}, class: ['btn', 'btn-sm', 'btn-danger', 'ml-2'] do
= link_to admin_access_control_path(acl), method: :delete, data: {confirm: "Would you really like to delete the access control for collection '#{acl.collection&.name}', role '#{acl.role&.name}', and user group #{acl.user_group&.name}?"}, class: ['btn', 'btn-sm', 'btn-danger', 'ml-2'] do
%span.icon-cross
Delete
= render 'common/pagination_bottom', item_name: 'access control'
Expand Down
Loading