Root.checkAccess (action, usr, level)
permission check (called by hopobject.onRequest())

  • Parameter String:
    name of action
  • Parameter Obj:
    User object
  • Parameter Int:
    Membership level
  • Returns
    Obj Exception object or null
Sourcecode in Root/securityFunctions.js:
1:   function checkAccess(action, usr, level) {
2:      try {
3:         switch (action) {
4:            case "new" :
5:               checkIfLoggedIn(this.href("new"));
6:               this.checkAdd(usr, level);
7:               break;
8:         }
9:      } catch (deny) {
10:        res.message = deny.toString();
11:        res.redirect(this.href());
12:     }
13:     return;
14:  }