Sha256: 8c0f1dfe02ebe56fd692283916f4c6541ab7f0d176e8631bc636223ddaadbc5e
Contents?: true
Size: 806 Bytes
Versions: 11
Compression:
Stored size: 806 Bytes
Contents
# frozen_string_literal: true module Hyrax module Forms ## # Nested form for permissions. # # @note due to historical oddities with Hydra::AccessControls and Hydra # Editor, Hyrax's views rely on `agent_name` and `access` as field # names. we provide these as virtual fields and prepopulate these from # `Hyrax::Permission`. class Permission < Hyrax::ChangeSet property :agent_name, virtual: true, prepopulator: ->(_opts) { self.agent_name = model.agent } property :access, virtual: true, prepopulator: ->(_opts) { self.access = model.mode } ## # @note support a {#to_hash} method for compatibility with # {Hydra::AccessControl::Permissions} def to_hash { name: agent_name, access: access } end end end end
Version data entries
11 entries across 11 versions & 1 rubygems