2011-01-11 56 views

回答

2

它允許檢查它是否允許讀取某個屬性的方法:

/// <summary> 
/// Returns <see langword="true" /> if the user is allowed to read the 
/// calling property. 
/// </summary> 
/// <param name="property">Property to check.</param> 
[EditorBrowsable(EditorBrowsableState.Advanced)] 
public virtual bool CanReadProperty(Csla.Core.IPropertyInfo property) 
{ 
    bool result = true; 

    VerifyAuthorizationCache(); 

    if (!_readResultCache.TryGetValue(property.Name, out result)) 
    { 
    result = BusinessRules.HasPermission(AuthorizationActions.ReadProperty, property); 
    // store value in cache 
    _readResultCache[property.Name] = result; 
    } 

    return result; 
} 
1

基本上,它可以讓你對各個屬性在不同的訪問權限一個商業對象。

0

它給予數據合同屬性的特定訪問權限。