private static void addMaintenanceDocumentCollectionPathToSecurityMappings(Map<String, AttributeSecurity> mappings, String propertyPathPrefix, MaintainableCollectionDefinition collectionDefinition) { propertyPathPrefix = propertyPathPrefix + collectionDefinition.getName() + "."; String boClassName = collectionDefinition.getBusinessObjectClass().getName(); for (MaintainableFieldDefinition field : collectionDefinition.getMaintainableFields()) { AttributeSecurity attributeSecurity = getDataDictionaryService().getAttributeSecurity(boClassName, field.getName()); if (attributeSecurity != null) { mappings.put(propertyPathPrefix + field.getName(), attributeSecurity); } } for (MaintainableCollectionDefinition nestedCollection : collectionDefinition.getMaintainableCollections()) { addMaintenanceDocumentCollectionPathToSecurityMappings(mappings, propertyPathPrefix, nestedCollection); } }
public static Map<String, AttributeSecurity> retrievePropertyPathToAttributeSecurityMappings(String docTypeName) { Map<String, AttributeSecurity> results = new HashMap<String, AttributeSecurity>(); MaintenanceDocumentEntry entry = getMaintenanceDocumentDictionaryService().getMaintenanceDocumentEntry(docTypeName); String className = entry.getDataObjectClass().getName(); for (MaintainableSectionDefinition section : entry.getMaintainableSections()) { for (MaintainableItemDefinition item : section.getMaintainableItems()) { if (item instanceof MaintainableFieldDefinition) { MaintainableFieldDefinition field = (MaintainableFieldDefinition) item; AttributeSecurity attributeSecurity = getDataDictionaryService().getAttributeSecurity(className, field.getName()); if (attributeSecurity != null) { results.put(field.getName(), attributeSecurity); } } else if (item instanceof MaintainableCollectionDefinition) { addMaintenanceDocumentCollectionPathToSecurityMappings(results, "", (MaintainableCollectionDefinition) item); } } } return results; }
AttributeSecurity attributeSecurity = KRADServiceLocatorWeb.getDataDictionaryService().getAttributeSecurity( businessObject.getClass().getName(), keyName); if (attributeSecurity != null && attributeSecurity.hasRestrictionThatRemovesValueFromUI()) {
if (field.getPropertyValue() != null && field.getPropertyValue().endsWith(EncryptionService.ENCRYPTION_POST_PREFIX)) { if (boAuthzService.attributeValueNeedsToBeEncryptedOnFormsAndLinks(businessObjectClass, field.getPropertyName())) { AttributeSecurity attributeSecurity = getDataDictionaryService().getAttributeSecurity(businessObjectClass.getName(), field.getPropertyName()); Person user = GlobalVariables.getUserSession().getPerson(); String decryptedValue = "";