Feature #5095 » add_to_permissions_from_plugins.patch
| lib/redmine/access_control.rb | ||
|---|---|---|
|
@public = options[:public] || false
|
||
|
@require = options[:require]
|
||
|
@project_module = options[:project_module]
|
||
|
add_actions(hash)
|
||
|
end
|
||
|
def add_actions(hash)
|
||
|
hash.each do |controller, actions|
|
||
|
if actions.is_a? Array
|
||
|
@actions << actions.collect {|action| "#{controller}/#{action}"}
|
||
| lib/redmine/plugin.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def add_permission(name, actions)
|
||
|
AccessControl.permission(name).add_actions(actions) unless AccessControl.permission(name).nil?
|
||
|
end
|
||
|
# Defines a project module, that can be enabled/disabled for each project.
|
||
|
# Permissions defined inside +block+ will be bind to the module.
|
||
|
#
|
||
- « Previous
- 1
- 2
- Next »