avniproject/avni-webapp

[DEA] Restrict subject selection based on user sync configuration

Opened this issue · 0 comments

As is:

  • Currently when filling value for subject concept in the form, we allow to select any subject from DEA, that might be outside of user's catchment as well.
  • In subject concept we only have access to the uuid of the subject
  • Via #1205, async execution of rules will get supported.
  • Via #1250, details related to logged in user will be available in DEA.

AC:

  • So in the rules where subject selection is involved for the org in focus, fetch the subject and check if its sync attributes is one of the sync attributes(of the corresponding subject type of the subject) set on the user. If not show the error, say for inventory, 'Select the inventory for which user has access to.'
  • User should not be able to save the subject with the above error