22using Microsoft . AspNetCore . Authorization ;
33using Microsoft . AspNetCore . Mvc ;
44using SimpleAuthentication . Permissions ;
5- using Swashbuckle . AspNetCore . Annotations ;
65
76namespace JwtBearerSample . Controllers ;
87
@@ -14,35 +13,35 @@ public class PeopleController : ControllerBase
1413{
1514 [ Authorize ( Policy = "PeopleRead" ) ] // [Permissions(Permissions.PeopleRead, Permissions.PeopleAdmin)]
1615 [ HttpGet ]
17- [ SwaggerOperation ( description : $ "This endpoint requires the '{ Permissions . PeopleRead } ' or '{ Permissions . PeopleAdmin } ' permissions") ]
16+ [ EndpointDescription ( description : $ "This endpoint requires the '{ Permissions . PeopleRead } ' or '{ Permissions . PeopleAdmin } ' permissions") ]
1817 public IActionResult GetList ( ) => NoContent ( ) ;
1918
2019 [ Authorize ( Policy = "PeopleRead" ) ] // [Permissions(Permissions.PeopleRead, Permissions.PeopleAdmin)]
2120 [ HttpGet ( "{id:int}" ) ]
2221 [ ProducesResponseType ( StatusCodes . Status204NoContent ) ]
2322 [ ProducesDefaultResponseType ]
24- [ SwaggerOperation ( description : $ "This endpoint requires the '{ Permissions . PeopleRead } ' or '{ Permissions . PeopleAdmin } ' permissions") ]
23+ [ EndpointDescription ( description : $ "This endpoint requires the '{ Permissions . PeopleRead } ' or '{ Permissions . PeopleAdmin } ' permissions") ]
2524 public IActionResult GetPerson ( int id ) => NoContent ( ) ;
2625
2726 [ Permission ( Permissions . PeopleWrite ) ]
2827 [ HttpPost ]
2928 [ ProducesResponseType ( StatusCodes . Status204NoContent ) ]
3029 [ ProducesDefaultResponseType ]
31- [ SwaggerOperation ( description : $ "This endpoint requires the '{ Permissions . PeopleWrite } ' permission") ]
30+ [ EndpointDescription ( description : $ "This endpoint requires the '{ Permissions . PeopleWrite } ' permission") ]
3231 public IActionResult Insert ( ) => NoContent ( ) ;
3332
3433 [ Permission ( Permissions . PeopleWrite ) ]
3534 [ HttpPut ]
3635 [ ProducesResponseType ( StatusCodes . Status204NoContent ) ]
3736 [ ProducesDefaultResponseType ]
38- [ SwaggerOperation ( description : $ "This endpoint requires the '{ Permissions . PeopleWrite } ' permission") ]
37+ [ EndpointDescription ( description : $ "This endpoint requires the '{ Permissions . PeopleWrite } ' permission") ]
3938 public IActionResult Update ( ) => NoContent ( ) ;
4039
4140 [ Permission ( Permissions . PeopleAdmin ) ]
4241 [ HttpDelete ( "{id:int}" ) ]
4342 [ ProducesResponseType ( StatusCodes . Status204NoContent ) ]
4443 [ ProducesDefaultResponseType ]
45- [ SwaggerOperation ( description : $ "This endpoint requires the '{ Permissions . PeopleAdmin } ' permission") ]
44+ [ EndpointDescription ( description : $ "This endpoint requires the '{ Permissions . PeopleAdmin } ' permission") ]
4645 public IActionResult Delete ( int id ) => NoContent ( ) ;
4746}
4847
0 commit comments