Sha256: b10a143d09795fce132e93050840900df02681bc14dd6d3373cc43f5b8fda3ca

Contents?: true

Size: 848 Bytes

Versions: 16

Compression:

Stored size: 848 Bytes

Contents

# frozen_string_literal: true
module Valkyrie
  class Resource
    # Provides an optional interface consistent with Hydra::AccessControls
    #
    # @example
    #     class CustomResource < Valkyrie::Resource
    #       include Valkyrie::Resource::AccessControls
    #       attribute :title
    #       attribute :member_ids
    #       attribute :nested_resource
    #     end
    #
    # @see https://github.com/samvera/hydra-head/tree/main/hydra-access-controls
    # @see lib/valkyrie/indexers/access_controls_indexer/rb
    module AccessControls
      def self.included(klass)
        klass.attribute :read_groups, Valkyrie::Types::Set
        klass.attribute :read_users, Valkyrie::Types::Set
        klass.attribute :edit_users, Valkyrie::Types::Set
        klass.attribute :edit_groups, Valkyrie::Types::Set
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
valkyrie-3.4.0 lib/valkyrie/resource/access_controls.rb
valkyrie-3.3.0 lib/valkyrie/resource/access_controls.rb
valkyrie-3.1.5 lib/valkyrie/resource/access_controls.rb
valkyrie-3.1.4 lib/valkyrie/resource/access_controls.rb
valkyrie-3.1.3 lib/valkyrie/resource/access_controls.rb
valkyrie-3.1.2 lib/valkyrie/resource/access_controls.rb
valkyrie-3.1.1 lib/valkyrie/resource/access_controls.rb
valkyrie-3.1.0 lib/valkyrie/resource/access_controls.rb
valkyrie-3.0.3 lib/valkyrie/resource/access_controls.rb
valkyrie-3.0.2 lib/valkyrie/resource/access_controls.rb
valkyrie-3.0.1 lib/valkyrie/resource/access_controls.rb
valkyrie-3.0.0 lib/valkyrie/resource/access_controls.rb
valkyrie-3.0.0.pre.rc.1 lib/valkyrie/resource/access_controls.rb
valkyrie-3.0.0.pre.beta.3 lib/valkyrie/resource/access_controls.rb
valkyrie-3.0.0.pre.beta.2 lib/valkyrie/resource/access_controls.rb
valkyrie-3.0.0.pre.beta.1 lib/valkyrie/resource/access_controls.rb