forked from noshutdown-ru/vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.rb
More file actions
executable file
·49 lines (43 loc) · 1.95 KB
/
Copy pathinit.rb
File metadata and controls
executable file
·49 lines (43 loc) · 1.95 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require_dependency "#{Rails.root}/plugins/vault/lib/encryptor"
require_dependency "#{Rails.root}/plugins/vault/lib/redmine_cipher"
require_dependency "#{Rails.root}/plugins/vault/lib/vault_cipher"
require_dependency "#{Rails.root}/plugins/vault/lib/project_patch"
require_dependency "#{Rails.root}/plugins/vault/lib/mk_keyfiles_dir"
AdminMenuVaultHooks = "AdminMenuVaultHooks"
require_relative "lib/admin_menu_vault_hooks"
Redmine::Plugin.register :vault do
name 'Vault plugin'
author 'noshutdown.ru'
description 'Plugin for keep keys and passwords'
version '0.11.0'
url 'https://github.com/noshutdown-ru/vault'
author_url 'https://noshutdown.ru/'
project_module :keys do
permission :export_keys, keys: [ :index ]
permission :keys_all, keys: [ :all ]
permission :download_keys, keys: [ :download ]
permission :view_keys, keys: [ :index, :edit, :show ]
permission :edit_keys, keys: [ :index, :new, :create, :edit, :show, :update, :destroy, :copy ], tags: [ :index, :create, :update, :destroy ]
permission :manage_whitelist_keys, keys: [ :index, :create, :edit, :show, :update, :copy ]
permission :whitelist_keys, keys: [ :index, :edit, :show ]
end
menu :project_menu,
:keys,
{ controller: 'keys', action: 'index' },
caption: Proc.new {I18n.t('label_module')},
param: :project_id
menu :top_menu,
:keys,
{ controller: 'keys', action: 'all' },
caption: Proc.new { I18n.t('label_module') },
:if => Proc.new {
visible = Setting.plugin_vault['show_top_menu'] == '1'
visible && User.current.allowed_to?({ :controller => 'keys', :action => 'all' }, nil, :global => true)
}
settings :default => {
'empty' => true,
'show_top_menu' => '1'
},
:partial => 'settings/vault_settings'
menu :admin_menu, :vault, {:controller => 'vault_settings', :action => 'index'}, :caption => :label_vault, :html => {:class => 'icon'}
end