Class: Hyrax::AccessControl
- Inherits:
-
Valkyrie::Resource
- Object
- Valkyrie::Resource
- Hyrax::AccessControl
- Defined in:
- app/models/hyrax/access_control.rb
Overview
A list of permissions pertaining to a specific object.
‘AccessControl`s consist of a set of permissions and an `#access_to` reference to the object that set governs.
Instance Attribute Summary collapse
-
#access_to ⇒ Valkyrie::ID
Supports query for ACLs at the resource level.
- #permissions ⇒ Enumerable<Hyrax::Permission>
Class Method Summary collapse
-
.for(resource:, query_service: Hyrax.query_service) ⇒ AccessControl
A finder/factory method for getting an appropriate ACL for a given resource.
Instance Attribute Details
#access_to ⇒ Valkyrie::ID
Supports query for ACLs at the resource level. Permissions should be grouped under an AccessControl with a matching ‘#access_to` so they can be retrieved in batch.
26 |
# File 'app/models/hyrax/access_control.rb', line 26 attribute :access_to, Valkyrie::Types::ID |
#permissions ⇒ Enumerable<Hyrax::Permission>
26 |
# File 'app/models/hyrax/access_control.rb', line 26 attribute :access_to, Valkyrie::Types::ID |
Class Method Details
.for(resource:, query_service: Hyrax.query_service) ⇒ AccessControl
A finder/factory method for getting an appropriate ACL for a given resource.
38 39 40 41 42 |
# File 'app/models/hyrax/access_control.rb', line 38 def self.for(resource:, query_service: Hyrax.query_service) query_service.custom_queries.find_access_control_for(resource: resource) rescue Valkyrie::Persistence::ObjectNotFoundError new(access_to: resource.id) end |