Field of type "reference" restricted to specific model allows to choose entry of some random model

Describe the bug:

Field of type reference restricted to specific model allows to choose entry from different model if user has no access to the model which it should be restricted to.
To simplify: There is model “model-a” which can be only accessed by Admin. There is some custom component with field of type reference with restriction to use only model “model-a” e.g:

{
name: “referenceToModelA”,
type: “reference”,
model: “model-a”
}

Then user who is not admin and has no access to the model “model-a” clicks button to select entry of the reference. This user can see list of entries which aren’t model “model-a”.

To Reproduce
Steps to reproduce the behavior:

  1. In Builder create model and restrict it only for some specific role
  2. Create custom component with reference field and restrict this field to the created model
  3. Log in to Builder on account which has not access to the created model
  4. Put created custom component on the page and select reference
  5. You can see list of entries which are not from the model you specified

Expected behavior
User without the access to the model shouldn’t see entries from model which is different from specified.
Maybe there should be some information that this user cannot change the reference because this user has no access to the model.
Maybe user should not be able to change value of this field because this user has no access to the model.

Hello @mateuszad,

Could you provide more context and clarify the following points:

  1. Is the user with restricted access to the model seeing contents from another model?
  2. What specific roles are you specifying for those users?

This additional information will help us better understand the situation and provide you with the appropriate assistance.

Thanks,

Hello @manish-sharma ,

thanks for your reply.

According to your first question - Yes, the role with restricted access is able to see other models but we can configure it not to see.

Second question - no matter what role (default or custom) for all the roles issue appears.

Hope that will be sufficient for you.

Many thanks.