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