8886: Experimental asynchronous permissions update.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 4 May 2016 18:55:03 +0000 (14:55 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 4 May 2016 19:01:32 +0000 (15:01 -0400)
commitae7d341b2a46d4740aa6ad76e2756ae6721ad874
tree646d0a87699967a8d9dced34b219c45b37ab20e9
parente8ccb474e5dbfee3d600fdd5ac3218ccb4625eb6
8886: Experimental asynchronous permissions update.

Add configuration parameter 'async_permissions_update' (default false).  If
true, do not delete permission cache in #invalidate_permissions_cache, but
instead trigger "NOTIFY invalidate_permissions_cache" on the database.

Add script/permission-updater.rb which runs as an independent process.  It
blocks on "LISTEN invalidate_permissions_cache" and updates the permission
cache whenever notified.

This is not ready for use; in particular it creates a race condition
recomputing permissions with effects such as not being able to read back API
records that were just created.
services/api/app/models/user.rb
services/api/config/application.default.yml
services/api/script/permission-updater.rb [new file with mode: 0755]