Sha256: 56c611e5e0965a2bdb71861156b96ed82697034581d39a03e6f89bcf2fa3dab9
Contents?: true
Size: 941 Bytes
Versions: 60
Compression:
Stored size: 941 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim # # Including this concern will enable a `register_permissions` class method to # be used for configuring the permissions for the includer artifact. # module RegistersPermissions extend ActiveSupport::Concern def self.register_permissions(artifact, *permission_classes) ::Decidim.permissions_registry.register_permissions(artifact, *permission_classes) end class_methods do # Registers the permissions for the given `artifact`. # # +artifact+ is expected to be the class or module that declares `NeedsPermission.permission_class_chain`. # +permission_classes+ are subclasses of `DefaultPermissions` or at least should quack as one. def register_permissions(artifact, *permission_classes) RegistersPermissions.register_permissions(artifact, *permission_classes) end end end end
Version data entries
60 entries across 60 versions & 1 rubygems