| Module | GateKeeper::ClassMethods |
| In: |
lib/gate_keeper.rb
|
GateKeeper::ClassMethods are automatically mixed into all ActiveRecord classes.
Returns true if User.current has permission to create instances of base class.
# File lib/gate_keeper.rb, line 124
124: def creatable?; return crudable?; end
Returns true if User.current has full CRUD permissions on all instances of base class.
# File lib/gate_keeper.rb, line 120
120: def crudable?; return !GateKeeper.enabled?; end
When set in the User class, allows users to commit virtual suicide. You probably do NOT want to set this, but it‘s here anyway.
# File lib/gate_keeper.rb, line 145
145: def destroyable_by_self; chain_self_method(:destroyable); end
When set in the User class, allows users to read themselves. You‘ll probably want to set either readable_by_all or readable_by_self for users, otherwise they‘ll have dificulty even logging in.
# File lib/gate_keeper.rb, line 136
136: def readable_by_self; chain_self_method(:readable); end