Best way to query current logged in user MasterData fields?

Hello, i’m trying to query all the user information when the user is logged in. (User test@gmail.com logs in, then through a React component retrieve all the CL information of the document in which the email is test@gmail.com)

I know there is an app called SafeData which acts as a middleware in order to query the information, but the problem with this app is that it also enables an endpoint for the user to patch his own document and control the value of every field.

Since some of the user fields are used as clusters (for example: userLevel, userPoints), i don’t want the user to be able to modify those fields.

Is there any alternative to query user information without SafeData or a way to use SafeData and disabling the permission to patch his own document?

Thanks in advance!

Hello there!

Thinking out of the box!

Maybe you will have to customize the SafeData application and include the non updatable fields.
Looks like the roadmap includes this feature (White-listing updateable fields), but who knows when it´s going to be implemented.

2 Likes

Hey there, thanks for the answer!

I really want that option to be added but i don’t have high hopes since SafeData source code was last updated on September 2021 :frowning:

I think i’ll customize it by deleting both the POST and PATCH methods so the only thing that works is the GET.

1 Like