Sha256: fa93c289749a0ac3c67b1059532257a70359e890006f31e9f1b715ba54a8ce78

Contents?: true

Size: 400 Bytes

Versions: 9

Compression:

Stored size: 400 Bytes

Contents

class ACLActionOverride < ApplicationController
  access_control :allowed?, :filter => false do
    allow all, :to => :index
    deny all, :to => :show
    allow :owner, :of => :foo, :to => :edit
  end

  def check_allow
    head allowed?(params[:_action]) ? :ok : :unauthorized
  end

  def check_allow_with_foo
    head allowed?(params[:_action], :foo => Foo.first) ? :ok : :unauthorized
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
acl9-2.1.2 test/dummy/app/controllers/acl_action_override.rb
acl9-2.1.1 test/dummy/app/controllers/acl_action_override.rb
acl9-2.1.0 test/dummy/app/controllers/acl_action_override.rb
acl9-2.0.0 test/dummy/app/controllers/acl_action_override.rb
acl9-1.3.0 test/dummy/app/controllers/acl_action_override.rb
acl9-1.2.1 test/dummy/app/controllers/acl_action_override.rb
acl9-1.2.0 test/dummy/app/controllers/acl_action_override.rb
acl9-1.1.0 test/dummy/app/controllers/acl_action_override.rb
acl9-1.0.0 test/dummy/app/controllers/acl_action_override.rb