在CanReadProperty框架中,CSLA.NET方法的目的是什么?
发布于 2011-01-11 11:37:45
它允许检查是否允许读取某个属性:
/// <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-26 11:26:45
基本上,它允许您对业务对象上的各个属性具有不同的访问权限。
发布于 2017-04-30 07:28:40
它赋予数据契约属性特定的访问权限。
https://stackoverflow.com/questions/4657047
复制相似问题