aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web/Controllers/RoleController.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-03-13 11:44:01 +0200
committertranstrike <transtrike@gmail.com>2021-03-13 11:44:25 +0200
commit93ded2b68a31fc9da643ac65955219e4f306ab82 (patch)
tree9647a722d5974337f999da34b9a023114b0a9324 /src/Web/DevHive.Web/Controllers/RoleController.cs
parent441f04790659a439c0054b7b06130d14cc2eb90b (diff)
downloadDevHive-93ded2b68a31fc9da643ac65955219e4f306ab82.tar
DevHive-93ded2b68a31fc9da643ac65955219e4f306ab82.tar.gz
DevHive-93ded2b68a31fc9da643ac65955219e4f306ab82.zip
XML Docs on all controllers
Diffstat (limited to 'src/Web/DevHive.Web/Controllers/RoleController.cs')
-rw-r--r--src/Web/DevHive.Web/Controllers/RoleController.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Web/DevHive.Web/Controllers/RoleController.cs b/src/Web/DevHive.Web/Controllers/RoleController.cs
index 1465795..ebb305e 100644
--- a/src/Web/DevHive.Web/Controllers/RoleController.cs
+++ b/src/Web/DevHive.Web/Controllers/RoleController.cs
@@ -9,6 +9,9 @@ using Microsoft.AspNetCore.Authorization;
namespace DevHive.Web.Controllers
{
+ /// <summary>
+ /// All endpoints for interacting with the roles layer
+ /// </summary>
[ApiController]
[Route("/api/[controller]")]
public class RoleController
@@ -22,6 +25,11 @@ namespace DevHive.Web.Controllers
this._roleMapper = mapper;
}
+ /// <summary>
+ /// Create a new role for the roles hierarchy. Admin only!
+ /// </summary>
+ /// <param name="createRoleWebModel">The new role's parametars</param>
+ /// <returns>The new role's Id</returns>
[HttpPost]
[Authorize(Roles = "Admin")]
public async Task<IActionResult> Create([FromBody] CreateRoleWebModel createRoleWebModel)
@@ -36,6 +44,11 @@ namespace DevHive.Web.Controllers
new OkObjectResult(new { Id = id });
}
+ /// <summary>
+ /// Get a role's full data, querying it by it's Id
+ /// </summary>
+ /// <param name="id">The role's Id</param>
+ /// <returns>Full info of the role</returns>
[HttpGet]
[Authorize(Roles = "User,Admin")]
public async Task<IActionResult> GetById(Guid id)
@@ -46,6 +59,12 @@ namespace DevHive.Web.Controllers
return new OkObjectResult(roleWebModel);
}
+ /// <summary>
+ /// Update a role's parametars. Admin only!
+ /// </summary>
+ /// <param name="id">The role's Id</param>
+ /// <param name="updateRoleWebModel">The new parametrats for that role</param>
+ /// <returns>Ok result</returns>
[HttpPut]
[Authorize(Roles = "Admin")]
public async Task<IActionResult> Update(Guid id, [FromBody] UpdateRoleWebModel updateRoleWebModel)
@@ -62,6 +81,11 @@ namespace DevHive.Web.Controllers
return new OkResult();
}
+ /// <summary>
+ /// Delete a role. Admin only!
+ /// </summary>
+ /// <param name="id">The role's Id</param>
+ /// <returns>Ok result</returns>
[HttpDelete]
[Authorize(Roles = "Admin")]
public async Task<IActionResult> Delete(Guid id)