aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Web/Controllers/UserController.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-01-23 16:01:05 +0200
committertranstrike <transtrike@gmail.com>2021-01-23 16:01:05 +0200
commit1f8d51c5393ea2f413de4f3e05f77d360d096ff3 (patch)
tree529dd85dfcae02a38ff6525c75c17db49f64bd91 /src/DevHive.Web/Controllers/UserController.cs
parentdf06bc309d44db352441f42de7d34794a6ee54ba (diff)
downloadDevHive-1f8d51c5393ea2f413de4f3e05f77d360d096ff3.tar
DevHive-1f8d51c5393ea2f413de4f3e05f77d360d096ff3.tar.gz
DevHive-1f8d51c5393ea2f413de4f3e05f77d360d096ff3.zip
The beginning of role based authorization
Diffstat (limited to 'src/DevHive.Web/Controllers/UserController.cs')
-rw-r--r--src/DevHive.Web/Controllers/UserController.cs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/DevHive.Web/Controllers/UserController.cs b/src/DevHive.Web/Controllers/UserController.cs
index fbbbbff..dd94089 100644
--- a/src/DevHive.Web/Controllers/UserController.cs
+++ b/src/DevHive.Web/Controllers/UserController.cs
@@ -7,15 +7,12 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using DevHive.Common.Models.Identity;
using DevHive.Services.Interfaces;
-using Microsoft.AspNetCore.JsonPatch;
-using DevHive.Common.Models.Misc;
-using System.Collections.Generic;
namespace DevHive.Web.Controllers
{
[ApiController]
[Route("/api/[controller]")]
- [Authorize(Roles = "User")]
+ [Authorize(Policy = "User")]
public class UserController : ControllerBase
{
private readonly IUserService _userService;
@@ -56,7 +53,6 @@ namespace DevHive.Web.Controllers
#endregion
#region Read
-
[HttpGet]
public async Task<IActionResult> GetById(Guid id, [FromHeader] string authorization)
{
@@ -71,7 +67,6 @@ namespace DevHive.Web.Controllers
[HttpGet]
[Route("GetUser")]
- [AllowAnonymous]
public async Task<IActionResult> GetUser(string username)
{
UserServiceModel friendServiceModel = await this._userService.GetUserByUsername(username);