The Modal Mixin

T
his mixin handles the behind the scences implementation of modes. The most common set of modes used are error, display, edit. One of the pages in the courses subsite uses some other esoteric modes like retire, unretire, renumber, verify....

The modes are implemented in terms of cookies. This mixin is responsible for sending the right cookie to the client's browser, getting the cookie to see if the client has the right permissions. In order for this to work, the display class must define its own permit_mode(self,mode) function which returns None if the client is not allowed to be in the mode mode for this page. Usually, you will need to use the perms.may function of the perms module.