本文整理汇总了C#中ActionCall.HasAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# ActionCall.HasAttribute方法的具体用法?C# ActionCall.HasAttribute怎么用?C# ActionCall.HasAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionCall
的用法示例。
在下文中一共展示了ActionCall.HasAttribute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addCreationPermission
private void addCreationPermission(ActionCall action)
{
// If there are no other permissioning, add one
if (!action.HasAttribute<AuthorizationAttribute>())
{
var permissionName = CrudRules.SecurableNameForCreation(_entityType);
action.ParentChain().Authorization.AddRole(permissionName);
}
}
示例2: ActionIsExempted
public static bool ActionIsExempted(ActionCall call)
{
if (call.HasAttribute<NotAuthenticatedAttribute>()) return true;
if (call.InputType() != null && call.InputType().HasAttribute<NotAuthenticatedAttribute>())
{
return true;
}
return false;
}
示例3: IsPassThrough
public static bool IsPassThrough(ActionCall call)
{
if (call.HasAttribute<PassThroughAuthenticationAttribute>()) return true;
if (call.InputType() != null && call.InputType().HasAttribute<PassThroughAuthenticationAttribute>())
{
return true;
}
return false;
}
示例4: ActionIsIncluded
public static bool ActionIsIncluded(ActionCall call)
{
if (call.HasAttribute<JsonBindingAttribute>()) return true;
if (call.InputType() != null && call.InputType().HasAttribute<JsonBindingAttribute>())
{
return true;
}
return false;
}
示例5: Matches
public bool Matches(ActionCall call, IConfigurationObserver log)
{
return call.HasAttribute<FubuDiagnosticsAttribute>();
}
示例6: Matches
public bool Matches(ActionCall call)
{
return call.HasAttribute<UrlPatternAttribute>();
}
示例7: modifyEditAction
private void modifyEditAction(ActionCall action)
{
// At least one Crud controller 'ignores' its Edit method
if (action == null) return;
var chain = action.ParentChain();
chain.Route = action.BuildRouteForPattern("{0}/{{Id}}".ToFormat(_routeName));
// If there are no
if (!action.HasAttribute<AuthorizationAttribute>())
{
var permissionName = CrudRules.SecurableNameForViewing(_entityType);
chain.Authorization.AddRole(permissionName);
}
// apply data restrictions
var policyType = typeof(RestrictedDataAuthorizationPolicy<>).MakeGenericType(_entityType);
chain.Authorization.AddPolicy(policyType);
action.AddAfter(Wrapper.For<CrudUrlBehavior>());
}