Sha256: b2df854b6c953608ff8eb467349c702227a7cd514381422bc934ce74fd5b46ca
Contents?: true
Size: 563 Bytes
Versions: 13
Compression:
Stored size: 563 Bytes
Contents
# frozen_string_literal: true module Decidim module <%= component_module_name %> module Admin class Permissions < Decidim::DefaultPermissions def permissions return permission_action if permission_action.scope != :admin return permission_action unless user&.admin? allow! if can_access? permission_action end def can_access? permission_action.subject == :<%= component_name.to_sym %> && permission_action.action == :read end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems