diff options
| author | Victor S <57849063+transtrike@users.noreply.github.com> | 2021-03-13 11:47:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-13 11:47:26 +0200 |
| commit | 4add0831649f6e534d3883aa0e0e7f380d8042c7 (patch) | |
| tree | 9647a722d5974337f999da34b9a023114b0a9324 /src/Web/DevHive.Web/Controllers/RoleController.cs | |
| parent | 02cf05d6cc38e6907404f65976440b811d6cc60a (diff) | |
| parent | 93ded2b68a31fc9da643ac65955219e4f306ab82 (diff) | |
| download | DevHive-4add0831649f6e534d3883aa0e0e7f380d8042c7.tar DevHive-4add0831649f6e534d3883aa0e0e7f380d8042c7.tar.gz DevHive-4add0831649f6e534d3883aa0e0e7f380d8042c7.zip | |
Merge pull request #20 from Team-Kaleidoscope/nswag
XML Documentation on Controllers
Diffstat (limited to 'src/Web/DevHive.Web/Controllers/RoleController.cs')
| -rw-r--r-- | src/Web/DevHive.Web/Controllers/RoleController.cs | 24 |
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) |
