Sha256: 1257477bfc6455b59f6aa08aea73cf64757d8c05020d901df055ccc564c33adb

Contents?: true

Size: 766 Bytes

Versions: 8

Compression:

Stored size: 766 Bytes

Contents

module CanTango
  class PermissionEngine < Engine
    module Loader
      class Base
        attr_accessor :file_name

        def self.inherited subclass
          subclass.extend ClassMethods
        end

        def parser
          raise NotImplementedError
        end

        def yml_content
          YAML.load_file(file_name)
        rescue
          raise "Couldn't load permissions file: #{file_name}. Either disable Permission engine or add this file."
        end

        module ClassMethods
          protected

          def config_file name
            File.join(config_path, "#{name}.yml") if rails?
          end

          def config_path
            CanTango.config.permissions.config_path
          end
        end
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/permission_engine/loader/base.rb
cantango-0.9.4.6 lib/cantango/permission_engine/loader/base.rb
cantango-0.9.4.5 lib/cantango/permission_engine/loader/base.rb
cantango-0.9.4.3 lib/cantango/permission_engine/loader/base.rb
cantango-0.9.4.2 lib/cantango/permission_engine/loader/base.rb
cantango-0.9.4.1 lib/cantango/permission_engine/loader/base.rb
cantango-0.9.4 lib/cantango/permission_engine/loader/base.rb
cantango-0.9.3.2 lib/cantango/permission_engine/loader/base.rb