Module: Authorization::ObjectRolesTable::UserExtensions::ClassMethods

Defined in:
lib/rails-authorization-plugin/lib/publishare/object_roles_table.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_authorized_user(roles_relationship_opts = {}) ⇒ Object


12
13
14
15
16
17
18
# File 'lib/rails-authorization-plugin/lib/publishare/object_roles_table.rb', line 12

def acts_as_authorized_user(roles_relationship_opts = {})
  has_many :user_role_bindings, class_name: 'Role::UserRole'
  has_many :roles, roles_relationship_opts.merge(through: :user_role_bindings, source: :role)
  #          has_and_belongs_to_many :roles, roles_relationship_opts
  include Authorization::ObjectRolesTable::UserExtensions::InstanceMethods
  include Authorization::Identity::UserExtensions::InstanceMethods # Provides all kinds of dynamic sugar via method_missing
end