Sha256: acb65cad63475b5d5ae631b1cc68df89faaae9909c8182dcca8adee0946b0c61

Contents?: true

Size: 468 Bytes

Versions: 46

Compression:

Stored size: 468 Bytes

Contents

module Itsf
  module Backend
    module Policies
      def policies
        Itsf::Backend::BasePolicy.subclasses
      end

      def policy_permissions
        policies.collect { |klass| klass.instance_methods(false) + klass.superclass.instance_methods(false).collect { |method_name| "#{klass.to_s.underscore}/#{method_name}" } }.flatten.delete_if { |method_name| method_name.to_s !~ /\?$/ }.collect { |permission| permission.chomp('?') }
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
itsf_backend-5.0.0.pre lib/itsf/backend/policies.rb
itsf_backend-4.2.3 lib/itsf/backend/policies.rb
itsf_backend-4.2.2 lib/itsf/backend/policies.rb
itsf_backend-4.2.1 lib/itsf/backend/policies.rb
itsf_backend-4.2.0 lib/itsf/backend/policies.rb
itsf_backend-4.0.1 lib/itsf/backend/policies.rb
itsf_backend-4.0.0 lib/itsf/backend/policies.rb
itsf_backend-3.1.1 lib/itsf/backend/policies.rb
itsf_backend-3.1.0 lib/itsf/backend/policies.rb
itsf_backend-3.0.7 lib/itsf/backend/policies.rb
itsf_backend-3.0.6 lib/itsf/backend/policies.rb
itsf_backend-3.0.5 lib/itsf/backend/policies.rb
itsf_backend-3.0.4 lib/itsf/backend/policies.rb
itsf_backend-3.0.3 lib/itsf/backend/policies.rb
itsf_backend-3.0.2 lib/itsf/backend/policies.rb
itsf_backend-3.0.1 lib/itsf/backend/policies.rb
itsf_backend-3.0.0 lib/itsf/backend/policies.rb
itsf_backend-2.2.1 lib/itsf/backend/policies.rb
itsf_backend-2.2.0 lib/itsf/backend/policies.rb
itsf_backend-2.1.0 lib/itsf/backend/policies.rb