Sha256: 959a6550594fce556156945ba076d8aaa685950c806781bd2f673024e0baf0a0

Contents?: true

Size: 1.73 KB

Versions: 24

Compression:

Stored size: 1.73 KB

Contents

module Authorization
	module V<%= api_version %>
		module <%= HorsePower.get_camel(resource_name) %>

			#Used in the controller

			def self.index?(tokenUser)
				return true
			end

			def self.show?(<%= HorsePower.get_singular(resource_name) %>,tokenUser)
				return true
			end

			def self.create?(<%= HorsePower.get_singular(resource_name) %>_params,tokenUser)
				return true
			end

			def self.update?(<%= HorsePower.get_singular(resource_name) %>,<%= HorsePower.get_singular(resource_name) %>_params,tokenUser)
        return true
			end

			def self.destroy?(<%= HorsePower.get_singular(resource_name) %>,tokenUser)
				return true
			end

			#Used in the serializer

			def self.include_id?(current_user,<%= HorsePower.get_singular(resource_name) %>_object,options)
	    	action = options[:url_options][:_recall][:action]
	    	controller = options[:url_options][:_recall][:controller]
				return true
			end
			
		<% attributes.each do |pair| -%>
	def self.include_<%= HorsePower.get_column(pair) %>?(current_user,<%= HorsePower.get_singular(resource_name) %>_object,options)
				action = options[:url_options][:_recall][:action]
	    	controller = options[:url_options][:_recall][:controller]
				return true
			end
			
		<% end -%>
	def self.include_created_at?(current_user,<%= HorsePower.get_singular(resource_name) %>_object,options)
	    	action = options[:url_options][:_recall][:action]
	    	controller = options[:url_options][:_recall][:controller]
				return true
			end

			def self.include_updated_at?(current_user,<%= HorsePower.get_singular(resource_name) %>_object,options)
	    	action = options[:url_options][:_recall][:action]
	    	controller = options[:url_options][:_recall][:controller]
				return true
			end

			private

		end
	end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
horse_power-1.0.0 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.9.0 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.8.5 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.8.3 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.8.2 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.8.1 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.8.0 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.7.1 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.7.0 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.6.5 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.6.0 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.5.0 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.4.1 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.4.0 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.3.3 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.3.2 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.2.1 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.2.0 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.1.6 lib/generators/horse_power/authorization/templates/auth_file.rb.erb
horse_power-0.1.5 lib/generators/horse_power/authorization/templates/auth_file.rb.erb