@@ -124,8 +124,8 @@ def admin?
124
124
#
125
125
# Overrides hydra-head, (and restores the method from blacklight-access-controls)
126
126
def download_permissions
127
- can :download , String do |id |
128
- test_download ( id )
127
+ can :download , [ :: String , :: Valkyrie :: ID ] do |id |
128
+ test_download ( id . to_s )
129
129
end
130
130
131
131
can :download , ::SolrDocument do |obj |
@@ -189,8 +189,8 @@ def uploaded_file_abilities
189
189
# self.ability_logic += [:proxy_deposit_abilities]
190
190
def proxy_deposit_abilities
191
191
if Flipflop . transfer_works?
192
- can :transfer , String do |id |
193
- user_is_depositor? ( id )
192
+ can :transfer , [ :: String , Valkyrie :: ID ] do |id |
193
+ user_is_depositor? ( id . to_s )
194
194
end
195
195
end
196
196
@@ -368,7 +368,7 @@ def admin_permissions
368
368
alias_action :show , to : :read
369
369
alias_action :discover , to : :read
370
370
can :update , :appearance
371
- can :manage , String # The identifier of a work or FileSet
371
+ can :manage , [ String , Valkyrie :: ID ] # The identifier of a work or FileSet
372
372
can :manage , curation_concerns_models
373
373
can :manage , Sipity ::WorkflowResponsibility
374
374
can :manage , :collection_types
@@ -414,9 +414,9 @@ def registered_user?
414
414
end
415
415
416
416
# Returns true if the current user is the depositor of the specified work
417
- # @param document_id [String] the id of the document.
417
+ # @param document_id [String, Valkyrie::ID ] the id of the document.
418
418
def user_is_depositor? ( document_id )
419
- doc = Hyrax ::SolrService . search_by_id ( document_id , fl : 'depositor_ssim' )
419
+ doc = Hyrax ::SolrService . search_by_id ( document_id . to_s , fl : 'depositor_ssim' )
420
420
current_user . user_key == doc [ 'depositor_ssim' ] &.first
421
421
end
422
422
0 commit comments