Make dropdown selection component load document model instead of composed document model after selection

Hey :slight_smile:

We have a CDM form (Person-CDM-FM) which contain a binding to manager.

Zrzut ekranu 2024-04-19 o 13.56.16

when the manger is selected with the dropdown, form engine tries to fetch cdm document of the manager.

Zrzut ekranu 2024-04-19 o 13.59.36

Here is the problem: we have some special logic in the backend which does not allow some users to see some CDMs, so after selecting some of the available options user is getting an error.

Zrzut ekranu 2024-04-19 o 14.01.36

The best solution for us would be to somehow make form engine load just document model after the selection, not the composed document model. Is it possible?

thanks

Hi,
I understand your issue in the following way:

You have a PersonCDM, which among other models is composed of a ManagerCDM, and the restricted user doesn’t have access to all the DocumentModels of which the ManagerCDM is composed.

At build time, PersonCDM is expanded to a single DM where the includes are resolved. This makes it possible to open such a Person CDM form and a Person document without manager for a restricted user.

When the restricted user selects an existing Manager from the dropdown in the form, the various documents needed for this manager are loaded. But then the error occurs, since the user doesn’t have access rights for some of the documents to be loaded.

Regarding the solution:

Which models are used and which documents are loaded is clearly determined by the modeling of the scene in the application model. On this level it is not possible to provide different variants based on user access rights.

I can imagine there is a way to achieve the desired behavior by creating a custom version of the cddDataProvider, but we would not recommend this.

Another solution might be to show a different client module to the restricted users. It is possible to show menu entries of modules only to users which have certain permissions. Then, for the restricted users a module could be created which allows editing a different Person form based on a different PersonCDM which isn’t composed of a ManagerCDM but only a ManagerDM. Then the error should be avoidable.

I hope this helps.

Greetings
Conrad

The thing is the Person-CDM-DM is not composed of ManagerCDM. The relation binded as Manager in PersonCDM model is relation to the standard document model (Person-DM, which is also used to compose Person-CDM-DM). We don’t want to list CDMs in the dropdown at all, we only want to list non-restricted data models. Once again, we don’t understand why composed data document is used in the dropdown, though the model used in relationship is not composed data model.