Only admins should be able to create new users (#896)
This commit is contained in:
parent
c5f69a5d0e
commit
70f7f34ac9
2 changed files with 3 additions and 1 deletions
|
@ -12,6 +12,7 @@ using API.Extensions;
|
|||
using API.Services;
|
||||
using AutoMapper;
|
||||
using Kavita.Common;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -77,6 +78,7 @@ namespace API.Controllers
|
|||
/// </summary>
|
||||
/// <param name="registerDto"></param>
|
||||
/// <returns></returns>
|
||||
[Authorize(Policy = "RequireAdminRole")]
|
||||
[HttpPost("register")]
|
||||
public async Task<ActionResult<UserDto>> Register(RegisterDto registerDto)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue