Beispiel #1
0
    public static ISchemaTypeDescriptor Authorize(
        this ISchemaTypeDescriptor self)
    {
        if (self == null)
        {
            throw new ArgumentNullException(nameof(self));
        }

        return(self.Directive(new AuthorizeDirective()));
    }
Beispiel #2
0
    public static ISchemaTypeDescriptor Authorize(
        this ISchemaTypeDescriptor self,
        string policy,
        params string[] roles)
    {
        if (self == null)
        {
            throw new ArgumentNullException(nameof(self));
        }

        return(self.Directive(new AuthorizeDirective(policy, roles)));
    }