mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-20 15:55:25 +03:00
refactor: simplify authz
This commit is contained in:
@@ -81,7 +81,7 @@ public class UserController : BaseJellyfinApiController
|
||||
/// <response code="200">Users returned.</response>
|
||||
/// <returns>An <see cref="IEnumerable{UserDto}"/> containing the users.</returns>
|
||||
[HttpGet]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public ActionResult<IEnumerable<UserDto>> GetUsers(
|
||||
[FromQuery] bool? isHidden,
|
||||
@@ -251,7 +251,7 @@ public class UserController : BaseJellyfinApiController
|
||||
/// <response code="404">User not found.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/> indicating success or a <see cref="ForbidResult"/> or a <see cref="NotFoundResult"/> on failure.</returns>
|
||||
[HttpPost("{userId}/Password")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
@@ -312,7 +312,7 @@ public class UserController : BaseJellyfinApiController
|
||||
/// <response code="404">User not found.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/> indicating success or a <see cref="ForbidResult"/> or a <see cref="NotFoundResult"/> on failure.</returns>
|
||||
[HttpPost("{userId}/EasyPassword")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
@@ -354,7 +354,7 @@ public class UserController : BaseJellyfinApiController
|
||||
/// <response code="403">User update forbidden.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/> indicating success or a <see cref="BadRequestResult"/> or a <see cref="ForbidResult"/> on failure.</returns>
|
||||
[HttpPost("{userId}")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
||||
@@ -440,7 +440,7 @@ public class UserController : BaseJellyfinApiController
|
||||
/// <response code="403">User configuration update forbidden.</response>
|
||||
/// <returns>A <see cref="NoContentResult"/> indicating success.</returns>
|
||||
[HttpPost("{userId}/Configuration")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
||||
public async Task<ActionResult> UpdateUserConfiguration(
|
||||
@@ -526,7 +526,7 @@ public class UserController : BaseJellyfinApiController
|
||||
/// <response code="400">Token is not owned by a user.</response>
|
||||
/// <returns>A <see cref="UserDto"/> for the authenticated user.</returns>
|
||||
[HttpGet("Me")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public ActionResult<UserDto> GetCurrentUser()
|
||||
|
||||
Reference in New Issue
Block a user