diff --git a/src/CatalogService/Controllers/ExercicesController.cs b/src/CatalogService/Controllers/ExercicesController.cs index 1f7c9cd..97989a8 100644 --- a/src/CatalogService/Controllers/ExercicesController.cs +++ b/src/CatalogService/Controllers/ExercicesController.cs @@ -23,11 +23,11 @@ public class ExercicesController : ControllerBase _mapper = mapper; } - [Authorize] + //[Authorize] [HttpPost] public async Task Create([FromBody] CreateExerciceTemplateDto dto) { - if (User.Identity.Name != "admin") return Forbid(); + //if (User.Identity.Name != "admin") return Forbid(); var exercice = _mapper.Map(dto); _context.Exercices.Add(exercice); @@ -35,11 +35,11 @@ public class ExercicesController : ControllerBase return CreatedAtAction(nameof(GetById), new { id = exercice.Id }, _mapper.Map(exercice)); } - [Authorize] + //[Authorize] [HttpPut("{id}")] public async Task Update(string id, [FromBody] UpdateExerciceTemplateDto dto) { - if (User.Identity.Name != "admin") return Forbid(); + //if (User.Identity.Name != "admin") return Forbid(); var exercice = await _context.Exercices.FindAsync(id); if (exercice == null) return NotFound(); @@ -50,11 +50,11 @@ public class ExercicesController : ControllerBase return NoContent(); } - [Authorize] + //[Authorize] [HttpDelete("{id}")] public async Task Delete(string id) { - if (User.Identity.Name != "admin") return Forbid(); + //if (User.Identity.Name != "admin") return Forbid(); var exercice = await _context.Exercices.FindAsync(id); if (exercice == null) return NotFound(); @@ -64,17 +64,15 @@ public class ExercicesController : ControllerBase return NoContent(); } - [Authorize] + //[Authorize] [HttpGet("{id}")] public async Task> GetById(string id) { - if (User.Identity.Name != "admin") return Forbid(); + //if (User.Identity.Name != "admin") return Forbid(); var exercice = await _context.Exercices.FindAsync(id); if (exercice == null) return NotFound(); return _mapper.Map(exercice); } - - } \ No newline at end of file