Skip to content

Commit

Permalink
[bugfix] Make sure API users with edit rights can PUT updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Feb 23, 2023
1 parent f1c8c3d commit be013f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit be013f3

Please sign in to comment.