0

CSLA.NETフレームワークでは、 CanReadPropertyメソッドの目的は何ですか?

4

3 に答える 3

3

特定のプロパティの読み取りが許可されているかどうかを確認できるメソッドです。

/// <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;
}
于 2011-01-11T11:37:45.080 に答える
1

基本的に、ビジネス オブジェクトの個々のプロパティに対して異なるアクセス許可を持つことができます。

于 2011-01-26T11:26:45.750 に答える