From 93ded2b68a31fc9da643ac65955219e4f306ab82 Mon Sep 17 00:00:00 2001 From: transtrike Date: Sat, 13 Mar 2021 11:44:01 +0200 Subject: XML Docs on all controllers --- src/Web/DevHive.Web/Controllers/RoleController.cs | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/Web/DevHive.Web/Controllers/RoleController.cs') 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 { + /// + /// All endpoints for interacting with the roles layer + /// [ApiController] [Route("/api/[controller]")] public class RoleController @@ -22,6 +25,11 @@ namespace DevHive.Web.Controllers this._roleMapper = mapper; } + /// + /// Create a new role for the roles hierarchy. Admin only! + /// + /// The new role's parametars + /// The new role's Id [HttpPost] [Authorize(Roles = "Admin")] public async Task Create([FromBody] CreateRoleWebModel createRoleWebModel) @@ -36,6 +44,11 @@ namespace DevHive.Web.Controllers new OkObjectResult(new { Id = id }); } + /// + /// Get a role's full data, querying it by it's Id + /// + /// The role's Id + /// Full info of the role [HttpGet] [Authorize(Roles = "User,Admin")] public async Task GetById(Guid id) @@ -46,6 +59,12 @@ namespace DevHive.Web.Controllers return new OkObjectResult(roleWebModel); } + /// + /// Update a role's parametars. Admin only! + /// + /// The role's Id + /// The new parametrats for that role + /// Ok result [HttpPut] [Authorize(Roles = "Admin")] public async Task Update(Guid id, [FromBody] UpdateRoleWebModel updateRoleWebModel) @@ -62,6 +81,11 @@ namespace DevHive.Web.Controllers return new OkResult(); } + /// + /// Delete a role. Admin only! + /// + /// The role's Id + /// Ok result [HttpDelete] [Authorize(Roles = "Admin")] public async Task Delete(Guid id) -- cgit v1.2.3