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
-
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(); -
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)