Module: Authoryze::Rails::ControllerExtensions

Extended by:
ActiveSupport::Concern
Defined in:
lib/authoryze/rails/controller_extensions.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#canObject



14
15
16
17
18
19
20
# File 'lib/authoryze/rails/controller_extensions.rb', line 14

def can
  @__can_authoryze ||= OpenStruct.new begin
    if resource = send(Authoryze.resource_accessor)
      Hash[resource.send(Authoryze.permissions_collection).map{|x| ['%s?' % x,true]}]
    end
  end
end