Changes between Version 4 and Version 5 of doc/developer/UserRolesArchitecture

Show
Ignore:
Timestamp:
12/05/06 23:56:56 (14 years ago)
Author:
benoitg
Comment:

Discuss exception implementation

Legend:

Unmodified
Added
Removed
Modified
  • doc/developer/UserRolesArchitecture

    v4 v5  
    5555 
    5656= Handling insufficient permission = 
    57 In the common case, missing permissions should be handled through exceptions, Caught in MainUI.  This will solve two annoying problems, while getting rid of just about all current permission error handling code: 
     57In the common case, missing permissions should be handled through exceptions. 
     58This will solve two annoying problems, while getting rid of just about all current permission error handling code: 
    5859        -If the user is not logged in (because of a timeout, or never logged-in), allow him to login. 
    5960        -If the user doesn't have the necessary permission(s), inform him (telling which permission is missing) and allow to login as another user. 
    6061In both cases, if the user successfully logs-in (with the rights permission), the get and post parameters are regenerated and the original operation is attempted again. 
    61  
    62 TODO:  Discuss exception handling more in depth: 
    63  * where do we catch them 
    64  * where do we throw them 
    65  * corner cases 
    66  * how do we define the exceptions (One exception sub-object per type?) 
     62== Exception Implementation == 
     63In think the simplest and cleanest way is to use set_exception_handler() to handle all exceptions outside MainUI, by calling a new MainUI with the prettily formatted error message and the request-repetition code.   
     64 * The downside is that all access control exceptions are now fatal.   
     65 * The upside is that it's really easy not to get stuck in the middle of a half-rendered page, and that we don't have to wrap all the top level scripts in try-catch blocks. 
    6766 
    6867= API =