-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinit.rb
executable file
·35 lines (29 loc) · 1.1 KB
/
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
29
30
31
32
33
34
35
require 'redmine'
# Patches to the Redmine core.
require 'dispatcher'
Dispatcher.to_prepare :redmine_cc_addresses do
require_dependency 'cc_addresses_issue_show_hook'
require_dependency 'issue'
# Guards against including the module multiple time (like in tests)
# and registering multiple callbacks
unless Issue.included_modules.include? RedmineCcAddresses::IssuePatch
Issue.send(:include, RedmineCcAddresses::IssuePatch)
end
require_dependency 'mailer'
unless Mailer.included_modules.include? RedmineCcAddresses::MailerPatch
Mailer.send(:include, RedmineCcAddresses::MailerPatch)
end
end
Redmine::Plugin.register :redmine_cc_addresses do
name 'Issue CC Addresses'
author 'Nick Peelman'
author_url 'http://peelman.us'
url 'http://github.com/peelman/redmine_cc_addresses'
description 'Allows CC Addresses to be attached to an issue'
version '0.2.0'
project_module :cc_addresses do |map|
map.permission :view_cc_addresses, { }
map.permission :add_cc_addresses, { :cc_addresses => :create }
map.permission :delete_cc_addresses, { :cc_addresses => :destroy }
end
end