Sha256: fc121ab64c343ba42f00a2af86c7ed3be43b77b163d47c7830c5dcfc9cdfc3b5

Contents?: true

Size: 848 Bytes

Versions: 4

Compression:

Stored size: 848 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

4 entries across 4 versions & 1 rubygems

Version Path
rails-acu-4.1.0 spec/dummy/config/initializers/acu_rules.rb
rails-acu-4.0.2 spec/dummy/config/initializers/acu_rules.rb
rails-acu-4.0.1 spec/dummy/config/initializers/acu_rules.rb
rails-acu-4.0.0 spec/dummy/config/initializers/acu_rules.rb