本文整理汇总了C#中IActor.HasPermission方法的典型用法代码示例。如果您正苦于以下问题:C# IActor.HasPermission方法的具体用法?C# IActor.HasPermission怎么用?C# IActor.HasPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IActor
的用法示例。
在下文中一共展示了IActor.HasPermission方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GrantDelete
/// <summary>
/// Returns empty BusinessRuleCollection indicating that the actor has permissions to delete the data requested.
/// </summary>
/// <param name="actor">Actor whose data-access permissions are to be checked.</param>
/// <returns>Collection of permissions (broken rules) that the actor has failed.</returns>
/// <remarks>Override in derived classes to add security checks.</remarks>
public virtual BusinessRuleCollection GrantDelete(IActor actor)
{
BusinessRuleCollection rules = new BusinessRuleCollection();
BusinessRule rule = new BusinessRule("Entity_GrantDelete", actor.HasPermission(Permissions.CustomerAddress_Delete), "Delete denied on this object.", 1);
rules.Add(rule);
return rules;
}
示例2: GrantSave
/// <summary>
/// Returns empty BusinessRuleCollection indicating that the actor has permissions to save the current object.
/// </summary>
/// <param name="actor">Actor whose data-access permissions are to be checked.</param>
/// <returns>Collection of permissions (broken rules) that the actor has failed.</returns>
/// <remarks>Override in derived classes to add security checks.</remarks>
public virtual BusinessRuleCollection GrantSave(IActor actor)
{
BusinessRuleCollection rules = new BusinessRuleCollection();
BusinessRule rule = new BusinessRule("Entity_GrantSave", actor.HasPermission(Permissions.ProductModelProductDescription_Update), "Update denied on this object.", 1);
rules.Add(rule);
return rules;
}
示例3: GrantFetch
/// <summary>
/// Returns empty BusinessRuleCollection indicating that the actor has permissions to fetch the data requested.
/// </summary>
/// <param name="actor">Actor whose data-access permissions are to be checked.</param>
/// <returns>Collection of permissions (broken rules) that the actor has failed.</returns>
/// <remarks>Override in derived classes to add security checks.</remarks>
public virtual BusinessRuleCollection GrantFetch(IActor actor)
{
BusinessRuleCollection rules = new BusinessRuleCollection();
BusinessRule rule = new BusinessRule("Entity_GrantFetch", actor.HasPermission(Permissions.Address_Read), "Fetch denied on this object.", 1);
rules.Add(rule);
return rules;
}
示例4: GrantSave
/// <summary>
/// Returns empty BusinessRuleCollection indicating that the actor has permissions to save the current object.
/// </summary>
/// <param name="actor">Actor whose data-access permissions are to be checked.</param>
/// <returns>Collection of permissions (broken rules) that the actor has failed.</returns>
/// <remarks>Override in derived classes to add security checks.</remarks>
public virtual BusinessRuleCollection GrantSave(IActor actor)
{
BusinessRuleCollection rules = new BusinessRuleCollection();
BusinessRule rule = new BusinessRule("Entity_GrantSave", actor.HasPermission(Permissions.SalesOrderDetail_Update), "Update denied on this object.", 1);
rules.Add(rule);
return rules;
}
示例5: GrantCreate
/// <summary>
/// Returns empty BusinessRuleCollection indicating that the actor has permissions to create the current object.
/// </summary>
/// <param name="actor">Actor whose data-access permissions are to be checked.</param>
/// <returns>Collection of permissions (broken rules) that the actor has failed.</returns>
/// <remarks>Override in derived classes to add security checks.</remarks>
public virtual BusinessRuleCollection GrantCreate(IActor actor)
{
BusinessRuleCollection rules = new BusinessRuleCollection();
BusinessRule rule = new BusinessRule("Entity_GrantCreate", actor.HasPermission(Permissions.Address_Insert), "Create denied on this object.", 1);
rules.Add(rule);
return rules;
}