Project

General

Profile

Feature #5095 » add_to_permissions_from_plugins.patch

updated for Redmine 1.3-stable branch - Lluís Gili, 2012-03-23 11:59

View differences:

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.
#
(2-2/2)