module Authorization::People::V1::User
Public Class Methods
destroy?(targetUser,tokenUser)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 26 def self.destroy?(targetUser,tokenUser) if targetUser != tokenUser #Can only destroy your own data return false else return true end end
include_attempts?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 67 def self.include_attempts?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return false end
include_confirmed?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 61 def self.include_confirmed?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return false end
include_created_at?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 79 def self.include_created_at?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return true end
include_email?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 43 def self.include_email?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return true end
include_id?(current_user,user_object,options)
click to toggle source
Used in the serializer, current_user may be nil
# File lib/generators/people/authorizations/templates/authorization.rb, line 37 def self.include_id?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return true end
include_locked?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 73 def self.include_locked?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return false end
include_password_digest?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 55 def self.include_password_digest?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return false end
include_tokens?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 92 def self.include_tokens?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] #if action == "index" && controller == "people/api/v1/users" #return false #end return false end
include_updated_at?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 85 def self.include_updated_at?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return true end
include_username?(current_user,user_object,options)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 49 def self.include_username?(current_user,user_object,options) action = options[:url_options][:_recall][:action] controller = options[:url_options][:_recall][:controller] return true end
index?(tokenUser)
click to toggle source
Used in the controller
# File lib/generators/people/authorizations/templates/authorization.rb, line 8 def self.index?(tokenUser) return true end
show?(targetUser,tokenUser)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 12 def self.show?(targetUser,tokenUser) return true end
update?(targetUser,tokenUser)
click to toggle source
# File lib/generators/people/authorizations/templates/authorization.rb, line 17 def self.update?(targetUser,tokenUser) if targetUser != tokenUser #Can only update your own data return false else return true end end