Source for user.hpp for Part 5

This document shows the contents of user.hpp if you are starting the tutorial in Part 5. Debugging and Revising Your Application.

class User {
   Request* Req;
   IString UserId;
   virtual IString View()     {return Unauthorized("View");}
   virtual IString ShowAdd()  {return Unauthorized("ShowAdd");}
   virtual IString Add()      {return Unauthorized("Add");}
   virtual IString Complete() {return Unauthorized("Complete");}
   public:
      User(Request* req) : Req(req),UserId("") {}
      User(): Req(0), UserId("") {}
      IString Action();
};

class Reader : public User {
      virtual IString View();
   public:
      Reader(Request* req) : User(req) {}
};

class Reviewer: public User {
      virtual IString Add(),
                      ShowAdd(),
                      View();
public:
   Reviewer(Request* req) : User(req) {}
};

class Author : public Reviewer {
      virtual IString View(),
                      Complete();
   public:
      Author(Request* req) : Reviewer (req) {}
};