当前位置: 首页>>代码示例>>Java>>正文


Java AttributeDefinition.getAttributeSecurity方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.datadictionary.AttributeDefinition.getAttributeSecurity方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeDefinition.getAttributeSecurity方法的具体用法?Java AttributeDefinition.getAttributeSecurity怎么用?Java AttributeDefinition.getAttributeSecurity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.datadictionary.AttributeDefinition的用法示例。


在下文中一共展示了AttributeDefinition.getAttributeSecurity方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFullyMaskedValue

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
public static String getFullyMaskedValue(String className, String fieldName, Object formObject, String propertyName) {
	String displayMaskValue = null;
	Object propertyValue = ObjectUtils.getPropertyValue(formObject, propertyName);

	DataDictionaryEntryBase entry = (DataDictionaryEntryBase) KRADServiceLocatorWeb.getDataDictionaryService()
			.getDataDictionary().getDictionaryObjectEntry(className);
	AttributeDefinition a = entry.getAttributeDefinition(fieldName);

	AttributeSecurity attributeSecurity = a.getAttributeSecurity();
	if (attributeSecurity != null && attributeSecurity.isMask()) {
		MaskFormatter maskFormatter = attributeSecurity.getMaskFormatter();
		displayMaskValue = maskFormatter.maskValue(propertyValue);

	}
	return displayMaskValue;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:WebUtils.java

示例2: getPartiallyMaskedValue

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
public static String getPartiallyMaskedValue(String className, String fieldName, Object formObject,
		String propertyName) {
	String displayMaskValue = null;
	Object propertyValue = ObjectUtils.getPropertyValue(formObject, propertyName);

	DataDictionaryEntryBase entry = (DataDictionaryEntryBase) KRADServiceLocatorWeb.getDataDictionaryService()
			.getDataDictionary().getDictionaryObjectEntry(className);
	AttributeDefinition a = entry.getAttributeDefinition(fieldName);

	AttributeSecurity attributeSecurity = a.getAttributeSecurity();
	if (attributeSecurity != null && attributeSecurity.isPartialMask()) {
		MaskFormatter partialMaskFormatter = attributeSecurity.getPartialMaskFormatter();
		displayMaskValue = partialMaskFormatter.maskValue(propertyValue);

	}
	return displayMaskValue;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:WebUtils.java

示例3: considerBusinessObjectFieldUnmaskAuthorization

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
protected void considerBusinessObjectFieldUnmaskAuthorization(Object dataObject, Person user, BusinessObjectRestrictions businessObjectRestrictions, String propertyPrefix, Document document) {
	DataObjectEntry objectEntry = getDataDictionaryService().getDataDictionary().getDataObjectEntry(dataObject.getClass().getName());
	for (String attributeName : objectEntry.getAttributeNames()) {
		AttributeDefinition attributeDefinition = objectEntry.getAttributeDefinition(attributeName);
		if (attributeDefinition.getAttributeSecurity() != null) {
			if (attributeDefinition.getAttributeSecurity().isMask() &&
					!canFullyUnmaskField(user, dataObject.getClass(), attributeName, document)) {
				businessObjectRestrictions.addFullyMaskedField(propertyPrefix + attributeName, attributeDefinition.getAttributeSecurity().getMaskFormatter());
			}
			if (attributeDefinition.getAttributeSecurity().isPartialMask() &&
					!canPartiallyUnmaskField(user, dataObject.getClass(), attributeName, document)) {
				businessObjectRestrictions.addPartiallyMaskedField(propertyPrefix + attributeName, attributeDefinition.getAttributeSecurity().getPartialMaskFormatter());
			}
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:BusinessObjectAuthorizationServiceImpl.java

示例4: copyFromAttributeDefinition

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void copyFromAttributeDefinition(AttributeDefinition attributeDefinition) {
    // label
    if (StringUtils.isEmpty(getLabel())) {
        setLabel(attributeDefinition.getLabel());
    }

    // short label
    if (StringUtils.isEmpty(getShortLabel())) {
        setShortLabel(attributeDefinition.getShortLabel());
    }

    // security
    if ((attributeDefinition.getAttributeSecurity() != null) && ((getDataFieldSecurity() == null) || (
            getDataFieldSecurity().getAttributeSecurity() == null))) {
        initializeComponentSecurity();

        getDataFieldSecurity().setAttributeSecurity(attributeDefinition.getAttributeSecurity());
    }

    // alternate property name
    if (getReadOnlyDisplayReplacementPropertyName() == null && StringUtils.isNotBlank(
            attributeDefinition.getAlternateDisplayAttributeName())) {
        setReadOnlyDisplayReplacementPropertyName(attributeDefinition.getAlternateDisplayAttributeName());
    }

    // additional property display name
    if (getReadOnlyDisplaySuffixPropertyName() == null && StringUtils.isNotBlank(
            attributeDefinition.getAdditionalDisplayAttributeName())) {
        setReadOnlyDisplaySuffixPropertyName(attributeDefinition.getAdditionalDisplayAttributeName());
    }

    // property editor
    if (getPropertyEditor() == null) {
        setPropertyEditor(attributeDefinition.getPropertyEditor());
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:41,代码来源:DataFieldBase.java

示例5: getAttributeSecurity

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
/**
 * @see org.kuali.rice.krad.service.DataDictionaryService#getAttributeDisplayMask(java.lang.String, java.lang.String)
 */
@Override
public AttributeSecurity getAttributeSecurity(String entryName, String attributeName) {
    AttributeSecurity attributeSecurity = null;

    AttributeDefinition attributeDefinition = getAttributeDefinition(entryName, attributeName);
    if (attributeDefinition != null) {
        attributeSecurity = attributeDefinition.getAttributeSecurity();
    }

    return attributeSecurity;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:TestDataDictionaryService.java

示例6: getAttributeSecurity

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
@Override
public AttributeSecurity getAttributeSecurity(String entryName, String attributeName) {
       AttributeSecurity attributeSecurity = null;

       AttributeDefinition attributeDefinition = getAttributeDefinition(entryName, attributeName);
       if (attributeDefinition != null) {
           attributeSecurity = attributeDefinition.getAttributeSecurity();
       }

       return attributeSecurity;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:DataDictionaryServiceImpl.java

示例7: considerBusinessObjectFieldModifyAuthorization

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
/**
 * @param dataObjectEntry if collectionItemBusinessObject is not null, then it is the DD entry for collectionItemBusinessObject.
 * Otherwise, it is the entry for primaryBusinessObject
 * @param primaryDataObject the top-level BO that is being inquiried or maintained
 * @param collectionItemBusinessObject an element of a collection under the primaryBusinessObject that we are evaluating view auths for
 * @param user the logged in user
 * @param businessObjectAuthorizer
 * @param inquiryOrMaintenanceDocumentRestrictions
 * @param propertyPrefix
 */
protected void considerBusinessObjectFieldModifyAuthorization(
		DataObjectEntry dataObjectEntry,
		Object primaryDataObject,
		BusinessObject collectionItemBusinessObject, Person user,
		BusinessObjectAuthorizer businessObjectAuthorizer,
		MaintenanceDocumentRestrictions maintenanceDocumentRestrictions,
		String propertyPrefix) {
	for (String attributeName : dataObjectEntry.getAttributeNames()) {
		AttributeDefinition attributeDefinition = dataObjectEntry
				.getAttributeDefinition(attributeName);
		if (attributeDefinition.getAttributeSecurity() != null) {
			Map<String, String> collectionItemPermissionDetails = new HashMap<String, String>();
			Map<String, String> collectionItemRoleQualifications = null;
			if (ObjectUtils.isNotNull(collectionItemBusinessObject)) {
				collectionItemPermissionDetails.putAll(getFieldPermissionDetails(collectionItemBusinessObject, attributeName));
				collectionItemPermissionDetails.putAll(businessObjectAuthorizer.
						getCollectionItemPermissionDetails(collectionItemBusinessObject));
				collectionItemRoleQualifications = new HashMap<String, String>(businessObjectAuthorizer.
						getCollectionItemRoleQualifications(collectionItemBusinessObject));
			}
			else {
				collectionItemPermissionDetails.putAll(getFieldPermissionDetails(primaryDataObject, attributeName));
			}
			if (attributeDefinition.getAttributeSecurity().isReadOnly()) {
				if (!businessObjectAuthorizer
							.isAuthorizedByTemplate(
									primaryDataObject,
									KRADConstants.KNS_NAMESPACE,
									KimConstants.PermissionTemplateNames.MODIFY_FIELD,
									user.getPrincipalId(),
									collectionItemPermissionDetails,
									collectionItemRoleQualifications)) {
					maintenanceDocumentRestrictions
							.addReadOnlyField(propertyPrefix + attributeName);
				}
			}
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:50,代码来源:BusinessObjectAuthorizationServiceImpl.java

示例8: copyFromAttributeDefinition

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
/**
 * Override of InputField copy to setup properties necessary to make the field usable for inputting
 * search criteria.
 *
 * <p>Note super is not being called because we don't want to add restirctions that can cause problems
 * with the use of wildcard</p>
 *
 * {@inheritDoc}
 */
@Override
public void copyFromAttributeDefinition(AttributeDefinition attributeDefinition) {
    // label
    if (StringUtils.isEmpty(getLabel())) {
        setLabel(attributeDefinition.getLabel());
    }

    // short label
    if (StringUtils.isEmpty(getShortLabel())) {
        setShortLabel(attributeDefinition.getShortLabel());
    }

    // security
    if ((attributeDefinition.getAttributeSecurity() != null) && ((getDataFieldSecurity() == null) || (
            getDataFieldSecurity().getAttributeSecurity() == null))) {
        initializeComponentSecurity();

        getDataFieldSecurity().setAttributeSecurity(attributeDefinition.getAttributeSecurity());
    }

    // options
    if (getOptionsFinder() == null) {
        setOptionsFinder(attributeDefinition.getOptionsFinder());
    }

    // use control from dictionary if not specified and convert for searching
    if (getControl() == null) {
        Control control = convertControlToLookupControl(attributeDefinition);
        setControl(control);
    }

    // overwrite maxLength to allow for wildcards and ranges; set a minimum max length unless it is greater than 100
    setMaxLength(100);
    if ( attributeDefinition.getMaxLength()!=null && (attributeDefinition.getMaxLength() > 100)) {
        setMaxLength(attributeDefinition.getMaxLength());
    }

    // set default value for active field to true
    if (getDefaultValue() == null || (getDefaultValue() instanceof String && StringUtils.isEmpty((String)getDefaultValue()))) {
        if ((StringUtils.equals(getPropertyName(), KRADPropertyConstants.ACTIVE))) {
            setDefaultValue(KRADConstants.YES_INDICATOR_VALUE);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:54,代码来源:LookupInputField.java

示例9: considerBusinessObjectFieldViewAuthorization

import org.kuali.rice.krad.datadictionary.AttributeDefinition; //导入方法依赖的package包/类
/**
 * @param dataObjectEntry if collectionItemBusinessObject is not null, then it is the DD entry for collectionItemBusinessObject.
 * Otherwise, it is the entry for primaryBusinessObject
 * @param primaryDataObject the top-level BO that is being inquiried or maintained
 * @param collectionItemBusinessObject an element of a collection under the primaryBusinessObject that we are evaluating view auths for
 * @param user the logged in user
 * @param businessObjectAuthorizer
 * @param inquiryOrMaintenanceDocumentRestrictions
 * @param propertyPrefix
 */
protected void considerBusinessObjectFieldViewAuthorization(
		DataObjectEntry dataObjectEntry,
		Object primaryDataObject,
		BusinessObject collectionItemBusinessObject,
		Person user,
		BusinessObjectAuthorizer businessObjectAuthorizer,
		InquiryOrMaintenanceDocumentRestrictions inquiryOrMaintenanceDocumentRestrictions,
		String propertyPrefix) {
	for (String attributeName : dataObjectEntry.getAttributeNames()) {
		AttributeDefinition attributeDefinition = dataObjectEntry
				.getAttributeDefinition(attributeName);
		if (attributeDefinition.getAttributeSecurity() != null) {
			if (attributeDefinition.getAttributeSecurity().isHide()) {
				Map<String, String> collectionItemPermissionDetails = new HashMap<String, String>();
				Map<String, String> collectionItemRoleQualifications = null;
				if (ObjectUtils.isNotNull(collectionItemBusinessObject)) {
					collectionItemPermissionDetails.putAll(getFieldPermissionDetails(collectionItemBusinessObject, attributeName));
					collectionItemPermissionDetails.putAll(businessObjectAuthorizer.
							getCollectionItemPermissionDetails(collectionItemBusinessObject));
					collectionItemRoleQualifications = new HashMap<String, String>(businessObjectAuthorizer.
							getCollectionItemRoleQualifications(collectionItemBusinessObject));
				}
				else {
					collectionItemPermissionDetails.putAll(getFieldPermissionDetails(primaryDataObject, attributeName));
				}
				if (!businessObjectAuthorizer
						.isAuthorizedByTemplate(
								primaryDataObject,
								KRADConstants.KNS_NAMESPACE,
								KimConstants.PermissionTemplateNames.VIEW_MAINTENANCE_INQUIRY_FIELD,
								user.getPrincipalId(),
								collectionItemPermissionDetails,
								collectionItemRoleQualifications)) {
					inquiryOrMaintenanceDocumentRestrictions
							.addHiddenField(propertyPrefix + attributeName);
				}
			}
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:51,代码来源:BusinessObjectAuthorizationServiceImpl.java


注:本文中的org.kuali.rice.krad.datadictionary.AttributeDefinition.getAttributeSecurity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。