Module: Marley::Plugins::CurrentUserMethods::ClassMethods
- Defined in:
- lib/marley/joints/user.rb
Instance Method Summary collapse
- #authorize_rest_delete(meth) ⇒ Object
- #authorize_rest_get(meth) ⇒ Object
- #authorize_rest_post(meth) ⇒ Object
- #authorize_rest_put(meth) ⇒ Object
- #current_user ⇒ Object
- #current_user_class ⇒ Object
- #current_user_ds ⇒ Object
- #requires_user?(verb = nil, meth = nil) ⇒ Boolean
Instance Method Details
#authorize_rest_delete(meth) ⇒ Object
33 |
# File 'lib/marley/joints/user.rb', line 33 def (meth):false; end |
#authorize_rest_get(meth) ⇒ Object
26 27 28 |
# File 'lib/marley/joints/user.rb', line 26 def (meth) model_actions[:get].to_a.include?(meth.to_sym) && !current_user.new? end |
#authorize_rest_post(meth) ⇒ Object
29 30 31 |
# File 'lib/marley/joints/user.rb', line 29 def (meth) new(($request[:post_params][resource_name.to_sym]||{}).reject {|k,v| v.nil?}).current_user_role=='owner' && meth.nil? end |
#authorize_rest_put(meth) ⇒ Object
32 |
# File 'lib/marley/joints/user.rb', line 32 def (meth);false; end |
#current_user ⇒ Object
22 |
# File 'lib/marley/joints/user.rb', line 22 def current_user; $request && $request[:user]; end |
#current_user_class ⇒ Object
23 |
# File 'lib/marley/joints/user.rb', line 23 def current_user_class; current_user.class; end |
#current_user_ds ⇒ Object
24 |
# File 'lib/marley/joints/user.rb', line 24 def current_user_ds; filter("#{table_name}__#{@owner_col}".to_sym => current_user[:id]); end |
#requires_user?(verb = nil, meth = nil) ⇒ Boolean
25 |
# File 'lib/marley/joints/user.rb', line 25 def requires_user?(verb=nil,meth=nil);true;end |