Class: Hyrax::VisibilityWriter
- Inherits:
-
Object
- Object
- Hyrax::VisibilityWriter
- Defined in:
- app/services/hyrax/visibility_writer.rb
Overview
Sets ACLs from a visibility string
Instance Attribute Summary collapse
Instance Method Summary collapse
- #assign_access_for(visibility:) ⇒ void
-
#initialize(resource:) ⇒ VisibilityWriter
constructor
A new instance of VisibilityWriter.
- #visibility_map ⇒ Object
Constructor Details
#initialize(resource:) ⇒ VisibilityWriter
Returns a new instance of VisibilityWriter.
29 30 31 32 |
# File 'app/services/hyrax/visibility_writer.rb', line 29 def initialize(resource:) self.resource = resource @permission_manager = resource. end |
Instance Attribute Details
#permission_manager ⇒ Hyrax::PermissionManager (readonly)
24 |
# File 'app/services/hyrax/visibility_writer.rb', line 24 attr_accessor :resource |
#resource ⇒ Valkyrie::Resource
24 25 26 |
# File 'app/services/hyrax/visibility_writer.rb', line 24 def resource @resource end |
Instance Method Details
#assign_access_for(visibility:) ⇒ void
This method returns an undefined value.
38 39 40 41 42 43 44 |
# File 'app/services/hyrax/visibility_writer.rb', line 38 def assign_access_for(visibility:) .read_groups = .read_groups.to_a - visibility_map.deletions_for(visibility: visibility) .read_groups = .read_groups.to_a + visibility_map.additions_for(visibility: visibility) end |
#visibility_map ⇒ Object
46 47 48 |
# File 'app/services/hyrax/visibility_writer.rb', line 46 def visibility_map Hyrax.config.visibility_map end |