Module: Walruz
- Extended by:
- Manager::AuthorizationQuery, Memoization
- Defined in:
- lib/walruz.rb,
lib/walruz/actor.rb,
lib/walruz/utils.rb,
lib/walruz/config.rb,
lib/walruz/policy.rb,
lib/walruz/manager.rb,
lib/walruz/subject.rb,
lib/walruz/exceptions.rb,
lib/walruz/core_ext/array.rb,
lib/walruz/more/pagination.rb,
lib/walruz/core_ext/memoization.rb,
lib/walruz/more/pagination/base.rb,
lib/walruz/more/pagination/view_helper.rb,
lib/walruz/more/pagination/will_paginate_collection.rb
Defined Under Namespace
Modules: Actor, CoreExt, Memoization, More, Subject, Utils Classes: ActionNotFound, AuthorizationActionsNotDefined, Config, Manager, NotAuthorized, Policy, PolicyHalted
Class Method Summary collapse
-
.fetch_policy(policy_label) ⇒ Walruz::Policy
Returns a Walruz::Policy Class represented by the specified label.
-
.policies ⇒ Hash<Symbol, Walruz::Policy>
Holds all the policies declared on the system.
- .setup {|config| ... } ⇒ Object
-
.version ⇒ Object
Global Walruz Methods ###.
Methods included from Memoization
Methods included from Manager::AuthorizationQuery
authorize, authorize!, can?, satisfies, satisfies!, satisfies?
Class Method Details
.fetch_policy(policy_label) ⇒ Walruz::Policy
Returns a Walruz::Policy Class represented by the specified label
50 51 52 53 54 |
# File 'lib/walruz.rb', line 50 def self.fetch_policy(policy_label) policy_clz = Walruz.policies[policy_label] raise ActionNotFound.new(:policy_label, :label => policy_label) if policy_clz.nil? policy_clz end |
.policies ⇒ Hash<Symbol, Walruz::Policy>
TODO:
Make this thread-safe
Holds all the policies declared on the system
38 39 40 |
# File 'lib/walruz.rb', line 38 def self.policies Walruz::Policy.policies end |
.setup {|config| ... } ⇒ Object
30 31 32 33 |
# File 'lib/walruz.rb', line 30 def self.setup config = Config.new yield config end |
.version ⇒ Object
Global Walruz Methods ###
24 25 26 27 28 |
# File 'lib/walruz.rb', line 24 def self.version require "yaml" version = YAML.load_file(File.dirname(__FILE__) + "/../VERSION.yml") "%s.%s.%s" % [version[:major], version[:minor], version[:patch]] end |