OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/lib/global_roles/access_control_patch.rb

27 lines
875 B

module GlobalRoles
module AccessControlPatch
def self.included(base)
base.send(:extend, ClassMethods)
base.class_eval do
class << self
alias_method :available_project_modules_without_no_global, :available_project_modules unless method_defined?(:available_project_modules_without_no_global)
alias_method :available_project_modules, :available_project_modules_with_no_global
end
end
end
module ClassMethods
def available_project_modules_with_no_global
@available_project_modules ||= @permissions.reject{|p| p.global? }.collect(&:project_module).uniq.compact
available_project_modules_without_no_global
end
def global_permissions
@permissions.select {|p| p.global?}
end
end
end
end
Redmine::AccessControl.send(:include, GlobalRoles::AccessControlPatch)