Sha256: 834376a7d4bbcd7ec85f30233aa5bb52021befa0245a507bc295bd83617da9b6

Contents?: true

Size: 1.53 KB

Versions: 17

Compression:

Stored size: 1.53 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?(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
				
			<% 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-0.5.2 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.5.1 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.5.0 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.9 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.8 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.7 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.6 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.5 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.4 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.3 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.2 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.1 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.4.0 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.3.9 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.3.6 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.3.5 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb
json_voorhees-0.3.0 lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb