How to set web modeler to Read-Only mode?

Hi, I have integrated camunda modeler in my angular application. I’m working with DMN tables and I want to change their behavior depending on the user authentication. If the user is authenticated then he could change the DMN Table data otherwise he shouldn’t be able to alter the data(read-only). How can I achieve this behavior?

@Niklas_Kiefer

Hello @Harshit_Dixit ,

for each bpmn-js library, there are 2 components: viewer and modeler.

You can achieve the desired behaviour by using a viewer component for read only purposes and a modeler component for editing.

I hope this helps

Jonathan

Hi @jonathan.lukas,

Thanks for your response.

Do you know any example related to this?

Hello @Harshit_Dixit ,

not right now, but I think that with Angular, this should not be too much of a deal. (if-else logic that loads either one or the other component).

I think that (as you already implemented the modeler, you are aware of the API and the docs in github.

Jonathan

Hello @Harshit_Dixit ,

given you are using Angular, you have encapsulated the Viewer and the Modeler in a component each.

Now you can evaluate permissions of the active in the parent component and use if/else logic to either show the modeler if the user is allowed or show the viewer if the user may only read the model.

Unfortunately, I have no example for this.

Jonathan

Hi @jonathan.lukas,

Thanks for mentioning Viewer & Modeler component as I’m new to Camunda so I didn’t know about this.

I was stuck for so long and now I have solved this issue.

Viewer & Modeler - Here I found the implementation.

Thanks @jonathan.lukas :slightly_smiling_face:

1 Like