Copy option for resource roles

Hi Jmix team
Can you add the copy option of resources like the legacy studio had?

How can I copy the resourcePolicies of an existing role, I tried the following JPQLs to copy from

  1. From ResourceRoleEntity
    final ResourceRoleEntity resourceRoleEntity = dataManager.load(ResourceRoleEntity.class)
    .query(“select s from sec_ResourceRoleEntity s where s.code = :code1”)
    .parameter(“code1”, resourceRoleModelCopyFrom1.getCode())
    .one();

  2. From ResourceRoleModel
    final ResourceRoleModel copyFrom = dataManager.load(ResourceRoleModel.class)
    .query(“select s from sec_ResourceRoleModel s where s.code = :code1”)
    .parameter(“code1”, resourceRoleModelCopyFrom1.getCode())
    .one();

But when I run run it, I get the following exception

java.lang.IllegalStateException: No results
at io.jmix.core.FluentLoader$ByQuery.one(FluentLoader.java:591)
at com.myapp.mdg.view.extresourcerolemodeldetail.ExtResourceRoleModelDetailView.createCopyResourceRoleModel(ExtResourceRoleModelDetailView.java:44)

Hi Mortoza!

Why do you want to copy roles? Why is role inheritance functionality not suitable for you?

Regards,
Dmiriy

Hi
I want to create a new role from an existing role where many authorizations are similar, just add/delete/change some attributes…