Sha256: 5146d87e52bd8e00ad9436ea59e893cddffc2ea22da4a18d9fba70f65060ba84

Contents?: true

Size: 1.59 KB

Versions: 17

Compression:

Stored size: 1.59 KB

Contents

module Authorization
	module <%= module_camel %>
		module V<%= api_version %>
			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?(<%= resource_singular %>_params,tokenUser)
					return true
				end

				def self.update?(<%= resource_singular %>,<%= resource_singular %>_params,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
				
			<% attributes.each do |pair| %>
				def self.include_<%= pair.split(/:/)[0] %>?(current_user,<%= resource_singular %>_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,<%= 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
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
json_voorhees-1.5.1 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.5.0 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.4.9 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.4.8 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.4.7 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.4.6 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.4.5 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.4.2 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.4.1 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.4.0 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.3.2 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.3.1 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.3.0 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-1.0.0 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.5.5 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.5.4 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.5.3 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb