-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.rb
More file actions
30 lines (23 loc) · 1002 Bytes
/
init.rb
File metadata and controls
30 lines (23 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true
raise 'Please activate sudo_mode in your configuration.yml, which is required for this plugin' unless Redmine::Configuration['sudo_mode']
loader = RedminePluginKit::Loader.new plugin_id: 'redmine_sudo'
Redmine::Plugin.register :redmine_sudo do
name 'Redmine sudo'
url 'https://github.com/alphanodes/redmine_sudo'
description 'Sudo functionality for user to get admin permission'
version RedmineSudo::VERSION
author 'AlphaNodes GmbH'
author_url 'https://alphanodes.com/'
requires_redmine version_or_higher: '6.1'
begin
requires_redmine_plugin :additionals, version_or_higher: '4.2.0'
rescue Redmine::PluginNotFound
raise 'Please install additionals plugin (https://github.com/alphanodes/additionals)'
end
menu :account_menu, :sudo, '#',
first: true,
caption: '',
html: { id: 'sudo-menu', method: :post },
if: proc { User.current.sudoer? }
end
RedminePluginKit::Loader.persisting { loader.load_model_hooks! }