sennetconsortium / entity-api

A set of web service calls to return information about SenNet entities
MIT License
0 stars 0 forks source link

Prevent self referencing when setting the ancestor of an entity #375

Closed maxsibilla closed 2 months ago

maxsibilla commented 2 months ago

Related to card https://github.com/orgs/sennetconsortium/projects/9/views/1?pane=issue&itemId=66805234

On a PUT to /entities/<id> (update_entity) we need to check that the ancestor (also direct_ancestor) does not contain the UUID of the entity that is being updated. We currently have several validators under before_property_update_validators so it is probably best to add an additional one here. See https://entity.api.sennetconsortium.org/entities/86e851a37c6d7f550823fe527d38512b on production for an example of this somehow being done.