Sha256: 38a20f6f72b0c8d623ed2345a0d371e0ce4f4f17d88d1b02bb406e32f727696a

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module Checkpoint
  class Credential
    # A Permission is simple extension to the base Credential, specifying its
    # type as a permission and providing a conceptual object to be instantiated
    # or passed.
    #
    # The most common use from outside Checkpoint will be by way of
    # {Checkpoint::Query::ActionPermitted}, which will ask whether a given named
    # action is permitted for a user. However, Permission could be extended or
    # modified to implement aliasing or hierarchy, for example.
    #
    # More likely, though, is advising the resolution of Permissions with a
    # role map and {Checkpoint::Credential::RoleMapResolver} or implementing a
    # custom {Checkpoint::Credential::Resolver}. Subclassing or monkey-patching
    # Permission should only be necessary if the application needs to extend
    # the actual behavior of the Permission objects, rather than just which
    # ones are resolved.
    class Permission < Credential
      TYPE = 'permission'

      def type
        TYPE
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
checkpoint-1.1.3 lib/checkpoint/credential/permission.rb
checkpoint-1.1.2 lib/checkpoint/credential/permission.rb
checkpoint-1.1.1 lib/checkpoint/credential/permission.rb
checkpoint-1.1.0 lib/checkpoint/credential/permission.rb