Sha256: e71f4a57237647492a39441c2b234a301b1c29b9f9483f45122dc42b76e388b3
Contents?: true
Size: 1.27 KB
Versions: 9
Compression:
Stored size: 1.27 KB
Contents
module <%= class_name %> # @see https://github.com/wallaby-rails/wallaby/blob/master/docs/authorizer.md class ApplicationAuthorizer < Wallaby::ModelAuthorizer # # base/abstract class? # base_class! # # set namespace # self.namespace = '<%= class_name %>' # specify which provider (:cancancan, :pundit or :default) to use. # :default means no authorization will be in use. # self.provider_name = :cancancan # Check user's permission for given action on given subject. # Raise Wallaby::Forbidden if user doesn't have permission # def authorize(action, subject) # super # do something for all the subclasses # end # Check and see if user is allowed to perform an action on given subject. # def authorized?(action, subject) # super # do something for all the subclasses # end # Restrict user to access certain scope. # def accessible_for(action, scope) # super # do something for all the subclasses # end # Restrict user to assign certain values. # def attributes_for(action, subject) # super # do something for all the subclasses # end # Restrict user to permit parameters. # def permit_params(action, subject) # super # do something for all the subclasses # end end end
Version data entries
9 entries across 9 versions & 1 rubygems