aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Web/Controllers/UserController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Web/Controllers/UserController.cs')
-rw-r--r--src/DevHive.Web/Controllers/UserController.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/DevHive.Web/Controllers/UserController.cs b/src/DevHive.Web/Controllers/UserController.cs
index dd94089..e409eea 100644
--- a/src/DevHive.Web/Controllers/UserController.cs
+++ b/src/DevHive.Web/Controllers/UserController.cs
@@ -12,7 +12,7 @@ namespace DevHive.Web.Controllers
{
[ApiController]
[Route("/api/[controller]")]
- [Authorize(Policy = "User")]
+ [Authorize(Roles = "User,Admin")]
public class UserController : ControllerBase
{
private readonly IUserService _userService;
@@ -104,5 +104,18 @@ namespace DevHive.Web.Controllers
return new OkResult();
}
#endregion
+
+ [HttpPost]
+ [Route("SuperSecretPromotionToAdmin")]
+ public async Task<IActionResult> SuperSecretPromotionToAdmin(Guid userId)
+ {
+ object obj = new
+ {
+ UserId = userId,
+ AdminRoleId = await this._userService.SuperSecretPromotionToAdmin(userId)
+ };
+
+ return new OkObjectResult(obj);
+ }
}
}