viraxslot / online-school-app

Backend for testing purposes.
0 stars 0 forks source link

A teacher can add a material to other teacher's course #66

Open Tatyana-Kravchenko opened 2 years ago

Tatyana-Kravchenko commented 2 years ago

Steps to reproduce Teacher created course (id: {{courseIdForMaterials}}) Post {{host}}/api/v1/courses

{
  "title": "How to create test cases1 {{coursePostfix}}",
  "description": "Basic course about test design technique",
  "visible": true,
  "categoryId": {{categoryIdForMaterial}}
}

Teacher 2 tries to add a material in teacher's course POST {{host}}/api/v1/courses/{{courseIdForMaterials}}/materials Request Body

{
  "title": "Additional material {{materialPostfix}}",
  "data": "stringstri",
  "order": 0
}

Actual behavior

  1. Status code is 200
  2. Response time is less than 1000 ms
  3. Teacher 2 added a new material in the teacher's course

Expected behavior

  1. Status code is 403
  2. Response time is less than 1000 ms
  3. Teacher 2 can't add a new material in the teacher's course
  4. The error text message ("You\'re not owner of this course, you can\'t change/remove it") is correct Screenshots If applicable, add screenshots to help explain your problem. image image image
viraxslot commented 2 years ago

@Tatyana-Kravchenko I think about collaboration. What do you think if we convert this bug to a feature? Maybe a teacher can invite the other teacher to work together on a course.