elide icon indicating copy to clipboard operation
elide copied to clipboard

Defer inline checks when processing relationships

Open justin-tay opened this issue 2 years ago • 2 comments

Resolves #2986

Description

This defers inline checks in the ActivePermissionExecutor when processing relationships.

  • Added a deferInlineChecks variable in the RequestScope
  • Modified ActivePermissionExecutor to also take into consideration the deferInlineChecks variable
  • Modified JsonApiAtomicOperations and JsonApiJsonPatch to set defer inline checks to true when post processing relationships.

Motivation and Context

Previously it was possible for two separate consecutive updates to succeed but when the same updates were bundled into a atomic operation or json patch request were failing due to permissions checks.

How Has This Been Tested?

Added the appropriate tests.

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

justin-tay avatar Jul 25 '23 08:07 justin-tay

I think the build test failure might be transient as I can't seem to replicate the failure of example.tests.AsyncTest locally.

justin-tay avatar Jul 27 '23 15:07 justin-tay

I think the build test failure might be transient as I can't seem to replicate the failure of example.tests.AsyncTest locally.

restarted the build

moizarafat avatar Jul 27 '23 17:07 moizarafat