mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 09:51:57 -04:00
only show menu item if user can log time
This commit is contained in:
2
init.rb
2
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
|
||||
|
||||
Reference in New Issue
Block a user