forked from Loriowar/redmine_issues_tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
28 lines (23 loc) · 993 Bytes
/
init.rb
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
require_dependency 'redmine_issues_tree/hook_listener'
plugin_name = :redmine_issues_tree
Redmine::Plugin.register plugin_name do
name 'Redmine Issues Tree plugin'
author 'Ivan Zabrovskiy'
description 'Provides a tree view of the issues list'
version RedmineIssuesTree::VERSION
url 'https://github.com/Loriowar/redmine_issues_tree'
author_url 'https://github.com/Loriowar'
settings partial: 'settings/redmine_issues_tree', default: { 'default_redirect_to_tree_view' => false }
end
Rails.configuration.to_prepare do
require_patch plugin_name, %w(issues_helper issues_controller)
end
# Assign permissions on a tree_view actions. Permissions is same as for :view_issues.
# Doesn't work without :find_optional_project filter in controller.
Redmine::AccessControl.
permissions.
find { |permission| permission.name == :view_issues }.
actions.
push('issues_trees/tree_index').
push('issues_trees/redirect_with_params').
push('issues_trees/tree_children')