Skip to content

Commit

Permalink
add some documentation for PermissionTemplateAccess
Browse files Browse the repository at this point in the history
the impact of `PermissionTemplateAccess` seems a little complicated, and is
easily overlooked. this at least gets some reference to it into the
`PermissionTemplate` docs. hopefully we can get some info into
AdministrativeSet, and some deeper docs on `PermissionTemplateAccess` itself
soon.
  • Loading branch information
tamsin johnson authored and tamsin johnson committed Jul 26, 2021
1 parent b19fa7a commit 4be5966
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/models/hyrax/permission_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,25 @@ module Hyrax
# - an embargo configuration ({#release_date} {#release_period}) for default
# embargo behavior.
#
# Additionally, the {PermissionTemplate} grants authority to perform actions
# that relate to the Administrative Set/Collection itself. Rules for who can
# deposit to, view(?!), or manage the admin set are governed by related
# {PermissionTemplateAccess} records. Administrat Sets should have a manager
# granted by some such record.
#
# @todo write up what "default embargo behavior", when it is applied, and how
# it interacts with embargoes specified by user input.
#
# @example cerating a permission template and manager for an admin set
# admin_set = Hyrax::AdministrativeSet.new(title: 'My Admin Set')
# admin_set = Hyrax.persister.save(resource: admin_set)
#
# template = PermissionTemplate.create!(source_id: admin_set.id.to_s)
# Hyrax::PermissionTemplateAccess.create!(permission_template: template,
# agent_type: Hyrax::PermissionTemplateAccess::USER,
# agent_id: user.user_key,
# access: Hyrax::PermissionTemplateAccess::MANAGE)
#
# @see Hyrax::AdministrativeSet
class PermissionTemplate < ActiveRecord::Base # rubocop:disable Metrics/ClassLength
self.table_name = 'permission_templates'
Expand Down

0 comments on commit 4be5966

Please sign in to comment.