Class: Hyrax::IiifAuthorizationService
- Inherits:
-
Object
- Object
- Hyrax::IiifAuthorizationService
- Defined in:
- app/services/hyrax/iiif_authorization_service.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #can?(_action, object) ⇒ Boolean
-
#initialize(controller) ⇒ IiifAuthorizationService
constructor
A new instance of IiifAuthorizationService.
Constructor Details
#initialize(controller) ⇒ IiifAuthorizationService
Returns a new instance of IiifAuthorizationService.
5 6 7 |
# File 'app/services/hyrax/iiif_authorization_service.rb', line 5 def initialize(controller) @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
4 5 6 |
# File 'app/services/hyrax/iiif_authorization_service.rb', line 4 def controller @controller end |
Instance Method Details
#can?(_action, object) ⇒ Boolean
Note:
we ignore the ‘action` param here in favor of the `:show` action for all permissions
10 11 12 |
# File 'app/services/hyrax/iiif_authorization_service.rb', line 10 def can?(_action, object) controller.current_ability.can?(:show, file_set_id_for(object)) end |