lundi 27 février 2017

How to check if the change in nested data is permissible

We have a nested JSON structure in our web app on the frontend like Rows > Columns > Elements > Rows > Columns > Elements ...

We also have an API call which sends the entire data as JSON to backend.

In the backend we have a set of several permissions, like column size change, row background change, element ordering change, etc that are permitted or denied for various types of users.

We want to identify in the backend if the change of the nested structure is permissible.

Example 1 [Update data]:

The user has CHANGED the size of a 'Column', where the size is represented as a property in 'Column' object.

or

Example 2 [Remove/Add data]:

The user has removed/added an 'Element' from a 'Column'.

We know that we can do full traverse on the entire tree, and understand if the change was permissible or not, but we are looking for a better and faster, resource saving solution for concurrent connections and many users/big trees.


This question seems to be general for different technologies, but I want to let you know that we are using Laravel / Lumen / Dingo in the backend & Ember.js on the frontend.

Thanks for reading and helping :)




Aucun commentaire:

Enregistrer un commentaire