viraxslot / online-school-app

Backend for testing purposes.
0 stars 0 forks source link

Unable to modify teacher-created course by admin #32

Open yanaaleeva opened 2 years ago

yanaaleeva commented 2 years ago

Pre-conditions There exists valid admin role account with valid credentials and generated token There exists course entitled "teacher1" created by teacher role with "id"=1 in "categoryId"=1

Steps to reproduce In Postman create collection, e.g. "testing"; Click "Add request"; Name request, e.g. "change course by admin": Choose "Bearer Token" in Auth tab; Type in admin token in "Token" text field; Choose "raw"and "json" in droplists in 'Body' tab; Type into "Body" text field json request:

{ "id": "1", "title": "other", "description": "xxx", "visible": "true", "categoryId": "1" }

Send PATCH request to http://qa-school-test.quantori.academy/api/v1/courses

Actual result: Code 404 Json response body is: { "errors": "Unable to find course record(s)" }

Expected result: Code 200 Admin user should be able to make changes in course.

Screenshots image

yanaaleeva commented 2 years ago

Let's assume that admin role is role of head of didactic of the course, I'd suggest to add "change course" possibility in review purposes. If not then expected result should be as: code 401 Error message :. "You are not the owner of this course. Changes are forbidden".

yanaaleeva commented 2 years ago

@viraxslot actually it is the admin who can't change course created by teacher