Module: AuthorizeRbac::AuthorizeRbacMethods

Defined in:
lib/authorize_rbac/authorize_rbac_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



3
4
5
6
7
8
# File 'lib/authorize_rbac/authorize_rbac_methods.rb', line 3

def self.extended(base)
  class <<base
    @rbac = {}
    attr_reader :rbac
  end
end

Instance Method Details

#access_listObject



20
21
22
# File 'lib/authorize_rbac/authorize_rbac_methods.rb', line 20

def access_list
  @rbac ||= {}
end

#method_added(method) ⇒ Object



14
15
16
17
18
# File 'lib/authorize_rbac/authorize_rbac_methods.rb', line 14

def method_added(method)
  return if private_method_defined? method
  access_list[method] = @roles
  @roles = nil
end

#roles(*roles) ⇒ Object



10
11
12
# File 'lib/authorize_rbac/authorize_rbac_methods.rb', line 10

def roles(*roles)
  @roles = roles
end