Sha256: d49d7dec920f2b7d5cf7e140c1d86ea5cba63417125f10f6da90e3c1b8582da3

Contents?: true

Size: 951 Bytes

Versions: 10

Compression:

Stored size: 951 Bytes

Contents

module Ecm::Rbac
  module Backend
    class ImportDefaultPermissionsServiceController < Itsf::Backend::Service::BaseController
      def self.service_class
        Ecm::Rbac::ImportDefaultPermissionsService
      end

      def invoke
        @filenames = load_filenames
        super
      end

      def call
        @filenames = load_filenames
        super
      end

      private

      def permitted_params
        params.require(:import_default_permissions_service).permit(:filename)
      end

      def load_filenames
        filenames = ::Rails::Engine.subclasses.map(&:instance).collect do |engine|
          filename = engine.root.join *%w(config rbac.yml)
          next unless File.readable? filename
          filename
        end.compact
        application_filename = Rails.root.join *%w(config rbac.yml)
        filenames << application_filename if File.readable? application_filename#
        filenames
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ecm_rbac_backend-1.0.0 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.11 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.10 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.9 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.8 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.7 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.6 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.5 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.4 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb
ecm_rbac_backend-0.0.3 app/controllers/ecm/rbac/backend/import_default_permissions_service_controller.rb