Sha256: 8e3f02f4059b0a0d019b2ccbcd1667275e063265b6ac2b2b8b15dc2fd9fba68f

Contents?: true

Size: 987 Bytes

Versions: 4

Compression:

Stored size: 987 Bytes

Contents

# frozen_string_literal: true

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

      def type
        TYPE
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
checkpoint-1.0.3 lib/checkpoint/credential/role.rb
checkpoint-1.0.2 lib/checkpoint/credential/role.rb
checkpoint-1.0.1 lib/checkpoint/credential/role.rb
checkpoint-1.0.0 lib/checkpoint/credential/role.rb