use of com.axelor.auth.db.PermissionAssistant in project axelor-open-suite by axelor.
the class PermissionAssistantController method fillObjects.
public void fillObjects(ActionRequest request, ActionResponse response) {
try {
PermissionAssistant assistant = request.getContext().asType(PermissionAssistant.class);
MetaField metaField = assistant.getMetaField();
if (metaField != null && (assistant.getObjectSet() == null || assistant.getObjectSet().isEmpty())) {
List<MetaModel> models = Beans.get(MetaModelRepository.class).all().filter("self.metaFields.relationship = 'ManyToOne'" + " and self.metaFields.typeName = ?1", metaField.getTypeName()).fetch();
Set<MetaModel> objectSet = new HashSet<>();
objectSet.addAll(models);
response.setValue("objectSet", objectSet);
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations