From 4c7f1611cbd05cce8eeff92ed042b187479177a0 Mon Sep 17 00:00:00 2001 From: Daniel Bengl Date: Wed, 9 Oct 2024 10:00:17 +0200 Subject: [PATCH] Update view permissions --- app/views/timer_sessions/_timer_container.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/timer_sessions/_timer_container.html.erb b/app/views/timer_sessions/_timer_container.html.erb index 339255a..7f1fe55 100644 --- a/app/views/timer_sessions/_timer_container.html.erb +++ b/app/views/timer_sessions/_timer_container.html.erb @@ -68,20 +68,20 @@
<% if timer_session.persisted? %>
- <% if User.current.allowed_to_globally?(action: :stop, controller: 'time_tracker') %> + <% if User.current.allowed_to_globally?(action: :update, controller: 'time_tracker') %> <%= f.button :stop, type: :submit, data: { name: 'timer-stop', form_target: 'stopButton' }, name: :stop do %> <%= t('timer_sessions.timer.stop') %> <% end %> <% end %> - <% if User.current.allowed_to_globally?(action: :cancel, controller: 'time_tracker') %> + <% if User.current.allowed_to_globally?(action: :destroy, controller: 'time_tracker') %> <%= f.button :cancel, type: :submit, data: { name: 'timer-cancel', confirm: l(:text_are_you_sure) }, class: 'ml-3', name: :cancel, value: :cancel, form: "timer-cancel-form" do %> <%= t('timer_sessions.timer.cancel') %> <% end %> <% end %>
- <% elsif !timer_session.persisted? && User.current.allowed_to_globally?(action: :start, controller: 'time_tracker') %> + <% elsif !timer_session.persisted? && User.current.allowed_to_globally?(action: :create, controller: 'time_tracker') %> <%= f.button :start, type: :submit, value: :start, data: { name: 'timer-start' }, name: :commit do %> <%= t('timer_sessions.timer.start') %>