Skip to content

Commit

Permalink
Merge pull request #524 from nulib/nu/deploy/staging
Browse files Browse the repository at this point in the history
Deploy API permissions fix
  • Loading branch information
mbklein authored Feb 24, 2023
2 parents bf7f0bb + 52c051e commit 1fcf1be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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
4 changes: 2 additions & 2 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bind 'tcp://0.0.0.0:3000'
ssl_bind '0.0.0.0', '3001',
cert: File.join(ENV['HOME'], '.dev_cert', 'dev.rdc.cert.pem'),
key: File.join(ENV['HOME'], '.dev_cert', 'dev.rdc.key.pem')
cert: ENV['SSL_CERT'],
key: ENV['SSL_KEY']

0 comments on commit 1fcf1be

Please sign in to comment.