add cancan for authorization
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<%= f.label :password, 'Password (optional)', class: 'label' %>
|
||||
<%= f.text_field :password, class: 'base-input' %>
|
||||
<%= f.password_field :password, class: 'base-input' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-control pt-2">
|
||||
|
||||
@@ -40,9 +40,11 @@
|
||||
</div>
|
||||
<div class="flex justify-between items-end mb-4 mt-8">
|
||||
<h2 class="text-3xl font-bold">Signing Certificates</h2>
|
||||
<%= link_to new_settings_esign_path, class: 'btn btn-primary btn-md', data: { turbo_frame: 'modal' } do %>
|
||||
<%= svg_icon('plus', class: 'w-6 h-6') %>
|
||||
<span>Upload Cert</span>
|
||||
<% if can?(:create, @encrypted_config) %>
|
||||
<%= link_to new_settings_esign_path, class: 'btn btn-primary btn-md', data: { turbo_frame: 'modal' } do %>
|
||||
<%= svg_icon('plus', class: 'w-6 h-6') %>
|
||||
<span>Upload Cert</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render 'alert' %>
|
||||
@@ -77,14 +79,14 @@
|
||||
<span class="badge badge-lg badge-info badge-outline">
|
||||
<%= item['status'] %>
|
||||
</span>
|
||||
<% else %>
|
||||
<% elsif can?(:update, @encrypted_config) %>
|
||||
<%= button_to settings_esign_path, method: :put, params: { name: item['name'] }, class: 'btn btn-outline btn-neutral btn-xs whitespace-nowrap', title: 'Delete', data: { turbo_confirm: 'Are you sure?' } do %>
|
||||
Make Default
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if item['name'] != EsignSettingsController::DEFAULT_CERT_NAME && item['status'] != 'default' %>
|
||||
<% if item['name'] != EsignSettingsController::DEFAULT_CERT_NAME && item['status'] != 'default' && can?(:destroy, @encrypted_config) %>
|
||||
<%= button_to settings_esign_path, params: { name: item['name'] }, method: :delete, class: 'btn btn-outline btn-error btn-xs', title: 'Delete', data: { turbo_confirm: 'Are you sure?' } do %>
|
||||
Remove
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user