Express returning "User is not authorized" when modifying object from another user Express returning "User is not authorized" when modifying object from another user mongoose mongoose

Express returning "User is not authorized" when modifying object from another user


You could add a 'master' or 'admin' field to your classroom, and store the Creator's userId in it.

Then you can allow the delete/modify, etc actions only for the user who is master of this particular classroom, while letting everyone in.