17 instantiations of ForbidResult
Microsoft.AspNetCore.Mvc.Core (5)
Authorization\AuthorizeFilter.cs (1)
193
context.Result = new
ForbidResult
(effectivePolicy.AuthenticationSchemes.ToArray());
ControllerBase.cs (4)
2387
=> new
ForbidResult
();
2401
=> new
ForbidResult
(authenticationSchemes);
2416
=> new
ForbidResult
(properties);
2432
=> new
ForbidResult
(authenticationSchemes, properties);
Microsoft.AspNetCore.Mvc.Core.Test (4)
ForbidResultTest.cs (4)
28
var result = new
ForbidResult
("", null);
59
var result = new
ForbidResult
(new[] { "Scheme1", "Scheme2" }, authProperties);
93
var result = new
ForbidResult
(expected);
121
var result = new
ForbidResult
(expected)
Microsoft.AspNetCore.Mvc.RazorPages (8)
PageBase.cs (4)
270
=> new
ForbidResult
();
283
=> new
ForbidResult
(authenticationSchemes);
297
=> new
ForbidResult
(properties);
312
=> new
ForbidResult
(authenticationSchemes, properties);
PageModel.cs (4)
602
=> new
ForbidResult
();
615
=> new
ForbidResult
(authenticationSchemes);
629
=> new
ForbidResult
(properties);
644
=> new
ForbidResult
(authenticationSchemes, properties);
55 references to ForbidResult
Microsoft.AspNetCore.Mvc.Core (20)
ControllerBase.cs (12)
2378
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default).
2380
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
2386
public virtual
ForbidResult
Forbid()
2390
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
2394
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
2400
public virtual
ForbidResult
Forbid(params string[] authenticationSchemes)
2404
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
2409
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
2415
public virtual
ForbidResult
Forbid(AuthenticationProperties properties)
2419
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
2425
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
2431
public virtual
ForbidResult
Forbid(AuthenticationProperties properties, params string[] authenticationSchemes)
ForbidResult.cs (8)
17
/// Initializes a new instance of <see cref="
ForbidResult
"/>.
25
/// Initializes a new instance of <see cref="
ForbidResult
"/> with the
35
/// Initializes a new instance of <see cref="
ForbidResult
"/> with the
45
/// Initializes a new instance of <see cref="
ForbidResult
"/> with the
56
/// Initializes a new instance of <see cref="
ForbidResult
"/> with the
68
/// Initializes a new instance of <see cref="
ForbidResult
"/> with the
98
var logger = loggerFactory.CreateLogger(typeof(
ForbidResult
));
124
[LoggerMessage(1, LogLevel.Information, $"Executing {nameof(
ForbidResult
)} with authentication schemes ({{Schemes}}).", EventName = "ForbidResultExecuting", SkipEnabledCheck = true)]
Microsoft.AspNetCore.Mvc.Core.Test (11)
Authorization\AuthorizeFilterTest.cs (7)
272
Assert.IsType<
ForbidResult
>(authorizationContext.Result);
298
Assert.IsType<
ForbidResult
>(authorizationContext.Result);
306
Assert.IsType<
ForbidResult
>(authorizationContext.Result);
326
Assert.IsType<
ForbidResult
>(authorizationContext.Result);
364
Assert.IsType<
ForbidResult
>(authorizationContext.Result);
399
Assert.IsType<
ForbidResult
>(authorizationContext.Result);
416
Assert.IsType<
ForbidResult
>(authorizationContext.Result);
ForbidResultTest.cs (4)
28
var
result = new ForbidResult("", null);
59
var
result = new ForbidResult(new[] { "Scheme1", "Scheme2" }, authProperties);
93
var
result = new ForbidResult(expected);
121
var
result = new ForbidResult(expected)
Microsoft.AspNetCore.Mvc.RazorPages (24)
PageBase.cs (12)
262
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default).
264
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
269
public virtual
ForbidResult
Forbid()
273
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
277
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
282
public virtual
ForbidResult
Forbid(params string[] authenticationSchemes)
286
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
291
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
296
public virtual
ForbidResult
Forbid(AuthenticationProperties properties)
300
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
306
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
311
public virtual
ForbidResult
Forbid(AuthenticationProperties properties, params string[] authenticationSchemes)
PageModel.cs (12)
594
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default).
596
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
601
public virtual
ForbidResult
Forbid()
605
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
609
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
614
public virtual
ForbidResult
Forbid(params string[] authenticationSchemes)
618
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
623
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
628
public virtual
ForbidResult
Forbid(AuthenticationProperties properties)
632
/// Creates a <see cref="
ForbidResult
"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
638
/// <returns>The created <see cref="
ForbidResult
"/> for the response.</returns>
643
public virtual
ForbidResult
Forbid(AuthenticationProperties properties, params string[] authenticationSchemes)