final String REGION_EXPRESSION = "context orders::regional_permission inv: region=object.region"; //$NON-NLS-1$
Permission regionalPermission = UamFactory.eINSTANCE.createPermission();
regionalPermission.setId("regional_permission"); //$NON-NLS-1$
regionalPermission.setName("regional_permission"); //$NON-NLS-1$
Constraint constraint = UamFactory.eINSTANCE.createConstraint();
regionalPermission.setConstraint(constraint);
constraint.setExpession(REGION_EXPRESSION);
region = EcoreFactory.eINSTANCE.createEAttribute();
region.setName("region"); //$NON-NLS-1$
EcoreUtil.setAnnotation(region, UamPackage.eNS_URI, "#description", "region where the order comes"); //$NON-NLS-1$ //$NON-NLS-2$
region.setEType(EcorePackage.eINSTANCE.getEString());
regionalPermission.getEStructuralFeatures().add(region);
regionalPermission.setPObject(order);
// EMFUtil.addPobject(regionalPermission, order);
pack.getEClassifiers().add(regionalPermission);
// viewOp.getPermission().add(regionalPermission);
// createOp.getPermission().add(regionalPermission);
// deleteOp.getPermission().add(regionalPermission);
// updateOp.getPermission().add(regionalPermission);
Permission userPermission = UamFactory.eINSTANCE.createPermission();
userPermission.setId("user_permission"); //$NON-NLS-1$
userPermission.setName("user_permission"); //$NON-NLS-1$
Constraint userConstraint = UamFactory.eINSTANCE.createConstraint();
userPermission.setConstraint(userConstraint);
userConstraint.setExpession(USER_EXPRESSION);
userID = EcoreFactory.eINSTANCE.createEAttribute();
EcoreUtil.setAnnotation(userID, UamPackage.eNS_URI, IAttributeConstant.ANNOTATION_KEY_RUNTIME, "true"); //$NON-NLS-1$
userID.setName("login"); //$NON-NLS-1$
userID.setEType(EcorePackage.eINSTANCE.getEString());
userPermission.getEStructuralFeatures().add(userID);