Module: Aclatraz
- Extended by:
- Helpers
- Defined in:
- lib/aclatraz.rb,
lib/aclatraz/acl.rb,
lib/aclatraz/guard.rb,
lib/aclatraz/store.rb,
lib/aclatraz/helpers.rb,
lib/aclatraz/suspect.rb,
lib/aclatraz/store/riak.rb,
lib/aclatraz/store/mongo.rb,
lib/aclatraz/store/redis.rb,
lib/aclatraz/store/cassandra.rb
Defined Under Namespace
Modules: Guard, Helpers, Store, Suspect Classes: ACL, AccessDenied, InvalidPermission, InvalidStore, InvalidSuspect, StoreNotInitialized, UndefinedAccessControlList
Class Method Summary collapse
-
.acl ⇒ Object
Access control lists fof all classes protected by Aclatraz.
-
.init(store, *args) ⇒ Object
Initialize Aclatraz system with given datastore.
-
.store ⇒ Object
Returns current datastore object, or raises
StoreNotInitialized
wheninit
method wasn’t called before.
Methods included from Helpers
camelize, pack, suspect_id, unpack
Class Method Details
.acl ⇒ Object
Access control lists fof all classes protected by Aclatraz.
50 51 52 |
# File 'lib/aclatraz.rb', line 50 def self.acl @acl ||= {} end |
.init(store, *args) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/aclatraz.rb', line 36 def self.init(store, *args) store = eval("Aclatraz::Store::#{camelize(store.to_s)}") unless store.is_a?(Class) @store = store.new(*args) rescue NameError raise InvalidStore, "The #{store.inspect} ACL store is not defined!" end |
.store ⇒ Object
Returns current datastore object, or raises StoreNotInitialized
when init
method wasn’t called before.
45 46 47 |
# File 'lib/aclatraz.rb', line 45 def self.store @store or raise StoreNotInitialized, "ACLatraz is not initialized!" end |