Sha256: d0906f0f9ebda6b7d7861716ea87dc303174cebb4f529de2d3ac72bb11843c61

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

module Authorization
	module <%= module_camel %>
		module <%= resource_camel %>

			#Used in the controller

			def self.index?(tokenUser)
				return true
			end

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

			def self.create?(tokenUser)
				return true
			end

			def self.update?(<%= resource_singular %>,tokenUser)
        return true
			end

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

			#Used in the serializer

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

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

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

			private

		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
json_voorhees-0.0.2 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.0.1 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb