Implemented  baseController protect middleware that requires users to be logged in to modify a resource