Connect user role to entity in system

2
How do you connect a user role to an entity that belongs to the user (for example, connecting a docter's log in account to the entity 'doctor')?
asked
2 answers
2

As i am working on the same assignment i might be able to help you out ;). I have created a new entity 'doctor' and created a userrole doctor in security. The entity docter is a generalization of Administration.account. When creating a new user of type doctor, an object of entity doctor is created. And the account is associated with the userrole doctor in a microflow (and can't be edited later on). Now you have an entity doctor which you can associate with patients, and a userrole doctor to give the doctor rights in the system.

answered
1

In your domain model, right-click on the Doctor entity and select Select generalization... Choose the Administration/Account object and then your Doctor entity will contain all the fields from Account.

Edit after clarification: It looks like I misunderstood what you were trying to achieve. I now understand that you want to automatically add people created in the Doctor entity to the corresponding application user role (permission role).

You should be able to achieve this with an After-Create microflow. Retrieve the (first only not a list) System.UserRole from the database using a query like [Name = 'DoctorRole'], then use a change action on your Doctor entity to Add the role retrieved to the System.UserRoles association.

answered