Sha256: bd5f83d36f919a96635ce2e4f753c2c503bb144b20e50d545ce1d192078541fa

Contents?: true

Size: 1.92 KB

Versions: 9

Compression:

Stored size: 1.92 KB

Contents

module Authorization
	module People
		module User

			#Used in the controller

			def self.register?
				return true
			end

			def self.login?
				return true
			end

			def self.logout?(tokenUser)
				return true
			end

			def self.index?(tokenUser)
				return true
			end

			def self.show?(targetUser,tokenUser)
				return true
			end


			def self.update?(targetUser,tokenUser)
				if targetUser != tokenUser
					#Can only update your own data
					return false
				else
					return true
				end
			end

			#Used in the serializer, current_user may be nil

			def self.include_id?(current_user,user_object,options)
	    	action = options[:url_options][:_recall][:action]
	    	controller = options[:url_options][:_recall][:controller]
				return true
			end

	    def self.include_email?(current_user,user_object,options)
	    	action = options[:url_options][:_recall][:action]
	    	controller = options[:url_options][:_recall][:controller]
	    	return true
	    end

	    def self.include_username?(current_user,user_object,options)
	    	action = options[:url_options][:_recall][:action]
	    	controller = options[:url_options][:_recall][:controller]
	    	return true
	    end

	    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

	    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

	    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

			private

		end
	end
end

Version data entries

9 entries across 7 versions & 1 rubygems

Version Path
json_voorhees-0.2.3 test/test_app/gems/authorization/lib/authorization/people/user.rb
json_voorhees-0.2.2 test/test_app/gems/authorization/lib/authorization/people/user.rb
json_voorhees-0.2.1 test/test_app/gems/authorization/lib/authorization/people/user.rb
json_voorhees-0.2.0 lib/generators/json_voorhees/setup_app/templates/user/user_authorizations.rb
json_voorhees-0.2.0 test/test_app/gems/authorization/lib/authorization/people/user.rb
json_voorhees-0.1.0 test/test_app/gems/authorization/lib/authorization/people/user.rb
json_voorhees-0.1.0 lib/generators/json_voorhees/setup_app/templates/user/user_authorizations.rb
json_voorhees-0.0.2 lib/generators/json_voorhees/setup_app/templates/user/user_authorizations.rb
json_voorhees-0.0.1 lib/generators/json_voorhees/setup_app/templates/user/user_authorizations.rb