Sha256: d37cb2ff1451f8587ad4fb44d49926e2a0033bba6967328fd2b722a2e9dbbf73

Contents?: true

Size: 842 Bytes

Versions: 11

Compression:

Stored size: 842 Bytes

Contents

# This is an examble, modify it as well
Acu::Rules.define do
  # anyone make a request could be count as everyone!
  whois :everyone { true }

  whois :admin, args: [:user] { |c| c and c.user_type.symbol == :ADMIN.to_s }

  whois :client, args: [:user] { |c| c and c.user_type.symbol == :PUBLIC.to_s }

  whois :pr, args: [:user] { |c| c and c.user_type.symbol == :PR.to_s }

  allow :everyone

  # define how is admin?
  # whois :admin, args: [:user] { |c| c and c.user_type  == :ADMIN.to_s }

  # define how is client?
  # whois :client, args: [:user] { |c| c and c.user_type == :CLIENT.to_s }

  # controller :home, except: [:some_secret_action] do
  #   allow :everyone
  # end

  # controller :admin, only: [:send_message] do
  #   allow :everyone
  # end

  # controller :admin, except: [:send_message] do
  #   allow :admin
  # end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rails-acu-3.0.8 spec/dummy/config/initializers/acu_rules.rb
rails-acu-3.0.7 spec/dummy/config/initializers/acu_rules.rb
rails-acu-3.0.6 spec/dummy/config/initializers/acu_rules.rb
rails-acu-3.0.3 spec/dummy/config/initializers/acu_rules.rb
rails-acu-3.0.1 spec/dummy/config/initializers/acu_rules.rb
rails-acu-3.0.0 spec/dummy/config/initializers/acu_rules.rb
rails-acu-2.2.0 spec/dummy/config/initializers/acu_rules.rb
rails-acu-2.1.0 spec/dummy/config/initializers/acu_rules.rb
rails-acu-2.0.0 spec/dummy/config/initializers/acu_rules.rb
rails-acu-1.3.0 spec/dummy/config/initializers/acu_rules.rb
rails-acu-1.2.1 spec/dummy/config/initializers/acu_rules.rb