Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DevHive.Web / Controllers / UserController.cs
diff options
context:
space:
mode:
Commit1f8d51c5393ea2f413de4f3e05f77d360d096ff3 (patch)
Author
 transtrike <transtrike@gmail.com>
2021-01-23 16:01:05 +0200
Committer
 transtrike <transtrike@gmail.com>
2021-01-23 16:01:05 +0200
Files529dd85dfcae02a38ff6525c75c17db49f64bd91 /src/DevHive.Web/Controllers/UserController.cs
DevHive-1f8d51c5393ea2f413de4f3e05f77d360d096ff3.tar
DevHive-1f8d51c5393ea2f413de4f3e05f77d360d096ff3.tar.gz
DevHive-1f8d51c5393ea2f413de4f3e05f77d360d096ff3.zip
Parentdf06bc309d44db352441f42de7d34794a6ee54ba (diff)
The beginning of role based authorization
1 files changed, 1 insertions, 6 deletions
-rw-r--r--src/DevHive.Web/Controllers/UserController.cs7
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);