oldPermissions.add(prole);
for (IRoleInstanceMetaInfo info : instances) {
Set<IAttributeMetaInfo> attributes = permission.getAttributes();
IPermissionInstanceMetaInfo permissionInstanceMetaInfo = permissionInstanceService.getPermissionInstanceImpl();
for (IAttributeMetaInfo attribute : attributes) {
IPermissionParameter param = permissionInstanceService.getPermissionParameterImpl();
param.setAttributeName(attribute.getName());
param.setPermissionInstance(permissionInstanceMetaInfo);
param.setValue(attribute.getDefaultValue());
permissionInstanceMetaInfo.addPermissionParameter(param);
}
permissionInstanceMetaInfo.setPermissionId(permission.getId());
permissionInstanceMetaInfo.setRoleInstance(info);
info.addPermissionInstance(permissionInstanceMetaInfo);