public void testCreateRoleInstance() throws Exception {
createRoleInstance();
}
private void createRoleInstance() throws Exception {
IRoleInstanceService roleInstService = getRoleInstService();
assertNotNull(roleInstService);
IPermissionInstanceService permissionService = getPermissionInstanceService();
assertNotNull(permissionService);
IPermissionService permService = getPermissionService();
IPermissionMetaInfo perm2 = permService.findPermission("com.jresearchsoft.flexess.examples.orders", "ManagePersonalOrders");
assertNotNull(perm2);
IPermissionInstanceMetaInfo pm = permissionService.getPermissionInstanceImpl();
pm.setPermissionId("user_permission");
IPermissionParameter param = permissionService.getPermissionParameterImpl();
param.setPermissionInstance(pm);
IAttributeMetaInfo am = perm2.getAttribute("uid");
param.setAttributeName(am.getId());
pm.addPermissionParameter(param);
IRoleInstanceMetaInfo rm = roleInstService.getRoleInstanceImpl("com.jresearchsoft.flexess.examples.orders");
rm.setName("customer");
rm.setRoleId("customer_role");
rm = roleInstService.saveRoleInstance(rm);
id2 = rm.getId();
pm.setRoleInstance(rm);
pm = permissionService.savePermissionInstance(pm);