...
Where is the code for permission templates?
- https://github.com/samvera/hyrax/blob/master/app/models/hyrax/permission_template.rb
- https://github.com/samvera/hyrax/blob/master/app/models/hyrax/permission_template_access.rb
- https://github.com/samvera/hyrax/blob/master/app/controllers/hyrax/admin/permission_templates_controller.rb
- https://github.com/samvera/hyrax/blob/master/app/controllers/hyrax/admin/permission_template_accesses_controller.rb
- https://github.com/samvera/hyrax/blob/master/app/forms/hyrax/forms/permission_template_form.rb
- https://github.com/samvera/hyrax/blob/master/db/migrate/20161021175854_create_permission_template.rb
- https://github.com/samvera/hyrax/blob/master/db/migrate/20161021180154_create_permission_template_access.rb
- https://github.com/samvera/hyrax/blob/master/db/migrate/20161116222307_add_release_to_permission_templates.rb
What information do they hold?
...
- participants for an admin set
- visibility template for a work created in an admin set
- selected workflow to use for works created in an admin set
You can get a good sense of what PTs hold by looking at the PTForm; https://github.com/samvera/hyrax/blob/master/app/forms/hyrax/forms/permission_template_form.rb
When are they created?
I'm guessing that it is when the admin set is created. And possibly when a work is created to hold participant information?
Yes, permission templates are created by the AdminSetCreateService: https://github.com/samvera/hyrax/blob/master/app/services/hyrax/admin_set_create_service.rb#L62
They can also be created by the DefaultAdminSetActor: https://github.com/samvera/hyrax/blob/master/app/actors/hyrax/actors/default_admin_set_actor.rb#L44
When are they used?
I'm guessing when a work is created, the participants are assigned access, the visibility of the work is set based on the visibility template, and the workflow is attached to the work.
I believe that is correct.