I am using REST-API add-on to synchronize data with our other systems and now I need to assign basic role for our users. But there is nothing in JMIX to assign more roles on faster way. So I wanted to assign them through API, but I didnt find any way to edit entity for role assigments.
Is there any way, how can I prepare this function for roles?
In order to assign roles programmatically you must create and persist an instance of
RoleAssignmentEntity roleAssignmentEntity = metadata.create(RoleAssignmentEntity.class); roleAssignmentEntity.setRoleCode(roleCode); roleAssignmentEntity.setUsername(username); roleAssignmentEntity.setRoleType(RoleAssignmentRoleType.RESOURCE);
If I misunderstood your question, then please explain in more details.
thanks for you informations. This solution is amazing for me in some of our programs but in synchronization program I need to use API.
I have found that we can Update/Create/Delete assign roles through entitiy “sec_RoleAssignmentEntity”.
Thank you for your time and have a nice day