-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
34 lines (29 loc) · 1.04 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
require 'redmine'
Redmine::Plugin.register :chiliproject_etherpad do
name 'Chiliproject Etherpad plugin'
author 'NicoPaez'
description 'This plugin integrates Etherpad into Chiliproject'
version '1.0.0'
url 'http://www.tipit.net'
end
Redmine::AccessControl.map do |map|
map.project_module :pads do |map|
map.permission :access_pads, {:pads => [:index, :show]}
map.permission :create_pads, {:pads => [:new, :destroy]}
end
end
Redmine::MenuManager.map :project_menu do |menu|
menu.push(:pads, { :controller => 'pads', :action => 'index' },{:param => :project_id})
menu.push(:new_pad, { :controller => 'pads', :action => 'new' }, {
:param => :project_id,
:caption => :label_pad_new,
:parent => :pads,
:if => Proc.new {|p| User.current.allowed_to?(:create_pads, p) }
})
menu.push(:view_pads, { :controller => 'pads', :action => 'index' }, {
:param => :project_id,
#:caption => :label_pad_new,
:parent => :pads
#:if => Proc.new {|p| User.current.allowed_to?(:create_pads, p)
})
end