Sha256: 56aad3fea448815ccf85f015dee6f8b9fee9ec77c4a06ea9465b9d535b865df2
Contents?: true
Size: 798 Bytes
Versions: 21
Compression:
Stored size: 798 Bytes
Contents
# frozen_string_literal: true module ActionPolicy module Policy # Create default rules and aliases: # - `index?` (=`false`) # - `create?` (=`false`) # - `new?` as an alias for `create?` # - `manage?` as a fallback for all unspecified rules (default rule) module Defaults def self.included(base) raise "Aliases support is required for defaults" unless base.ancestors.include?(Aliases) base.default_rule :manage? base.alias_rule :new?, to: :create? raise "Verification context support is required for defaults" unless base.ancestors.include?(Aliases) base.authorize :user end def index?() ; false; end def create?() ; false; end def manage?() ; false; end end end end
Version data entries
21 entries across 21 versions & 1 rubygems