Class: Redmine::AccessControl::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/access_control.rb

Instance Method Summary collapse

Constructor Details

#initializeMapper

Returns a new instance of Mapper.



80
81
82
# File 'lib/redmine/access_control.rb', line 80

def initialize
  @project_module = nil
end

Instance Method Details

#mapped_permissionsObject



97
98
99
# File 'lib/redmine/access_control.rb', line 97

def mapped_permissions
  @permissions
end

#permission(name, hash, options = {}) ⇒ Object



84
85
86
87
88
89
# File 'lib/redmine/access_control.rb', line 84

def permission(name, hash, options={})
  @permissions ||= []
  @permissions.reject! {|p| p.name == name}
  options[:project_module] = @project_module
  @permissions << Permission.new(name, hash, options)
end

#project_module(name, options = {}) {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



91
92
93
94
95
# File 'lib/redmine/access_control.rb', line 91

def project_module(name, options={})
  @project_module = name
  yield self
  @project_module = nil
end