You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apply_x methods in registry server check permissions on the object that's passed in the request. This is correct for object creation, but overlooks updates. During updates we should be checking permissions on the existing object as well. With current behavior, user is allowed to overwrite objects even when updates aren't allowed.
Possible Solution
Pseudocode for a typical apply method should look something like this:
Check if the object already exists in the registry
Assert update permission on the existing object (if it exists)
Assert create permission on the object contained in the request
Proceed with apply
The text was updated successfully, but these errors were encountered:
The problem isn't the order, it's the fact that assert is happening on a wrong object. Say I have an update permission on objects tagged like {"team": "A"} and I'm applying an update to an entity that already exists and is tagged like {"team": "B"}. The code above checks only the fact that I'm authorized to create entities of team A and overwrites team B's object because existing object is never touched during permission assertion.
There should be two separate asserts, one on the object that's already in the registry and another one on the object that's supplied as part of the request.
Current Behavior
apply_x
methods in registry server check permissions on the object that's passed in the request. This is correct for object creation, but overlooks updates. During updates we should be checking permissions on the existing object as well. With current behavior, user is allowed to overwrite objects even when updates aren't allowed.Possible Solution
Pseudocode for a typical apply method should look something like this:
The text was updated successfully, but these errors were encountered: