-
Notifications
You must be signed in to change notification settings - Fork 4
/
init.rb
37 lines (31 loc) · 1.14 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
36
37
require 'redmine'
require_dependency 'wiki_patches/hook' #Apply views modifications
Rails.configuration.to_prepare do
#Apply patch on wiki controller
require_dependency 'wiki_controller'
unless WikiController.included_modules.include? WikiPatches::WikiControllerPatch
WikiController.send(:include, WikiPatches::WikiControllerPatch)
end
#Apply patch on wiki page
require_dependency 'wiki_page'
unless WikiPage.included_modules.include? WikiPatches::WikiPagePatch
WikiPage.send(:include, WikiPatches::WikiPagePatch)
end
require_dependency 'application_helper'
unless ApplicationHelper.included_modules.include? WikiPatches::ApplicationHelperPatch
ApplicationHelper.send(:include, WikiPatches::ApplicationHelperPatch)
end
end
Redmine::Plugin.register :redmine_private_wiki do
name 'Private Wiki plugin'
author 'Alexandre BOUDINE'
description 'Add privatization of wiki pages'
version '0.2.0'
url ''
author_url ''
#Add permissions
project_module :wiki do
permission :view_privates_wiki, {:wiki => [:show, :edit]}
permission :manage_privates_wiki, {:wiki => :change_privacy}, :require => :member
end
end