diff --git a/app/models/ability.rb b/app/models/ability.rb index 9d1b69ef31..66d1d0056b 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -161,6 +161,11 @@ def custom_permissions(user=nil, session=nil) # anyone who can edit a media_object can also push it can? :edit, media_object end + + can :json_update, MediaObject do |media_object| + # anyone who can edit a media_object can also update it via the API + is_api_request? && can?(:edit, media_object) + end end end