From ba92f9fc30d81c839462d3f6e6899cc0766fc468 Mon Sep 17 00:00:00 2001 From: Jens Kraemer Date: Fri, 24 Apr 2020 17:22:45 +0800 Subject: [PATCH] only show menu item if user can log time --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 3dc3b7a..f445600 100644 --- a/init.rb +++ b/init.rb @@ -16,7 +16,7 @@ Redmine::Plugin.register :stopwatch do caption: :button_log_time, html: { method: :get, id: 'stopwatch-toggle', 'data-remote': true }, before: :my_account, - if: ->(*_){ User.current.logged? } + if: ->(*_){ User.current.logged? and User.current.allowed_to?(:log_time, nil, global: true) } end Rails.configuration.to_prepare do