/// <inheritdoc /> public ITypeSetExposureConfiguration Authorize(string role = null, string policy = null) { IEndPointMethodAuthorization authorization = null; if (!string.IsNullOrEmpty(policy)) { authorization = new UserHasPolicy(policy); } else if (!string.IsNullOrEmpty(role)) { authorization = new UserHasRole(role); } else { authorization = new UserIsAuthorized(); } return(Authorize(type => new[] { authorization })); }
public IExposureConfiguration Authorize(string role = null, string policy = null) { IEndPointMethodAuthorization authorization = null; if (!string.IsNullOrEmpty(policy)) { authorization = new UserHasPolicy(policy); } else if (!string.IsNullOrEmpty(role)) { authorization = new UserHasRole(role); } else { authorization = new UserIsAuthorized(); } _authorizations = _authorizations.Add(authorization); return(this); }