PollMgr.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 PollMgr/securityFunctions.js:
1:   function checkAccess(action, usr, level) {
2:      try {
3:         switch (action) {
4:            case "main" :
5:               checkIfLoggedIn(this.href(req.action));
6:               var url = this._parent.href();
7:               this.checkAdd(usr, level);
8:               break;
9:            case "open" :
10:              checkIfLoggedIn(this.href(req.action));
11:              var url = this._parent.href();
12:              this.checkAdd(usr, level);
13:              break;
14:           case "mypolls" :
15:              checkIfLoggedIn(this.href(req.action));
16:              var url = this._parent.href();
17:              this.checkAdd(usr, level);
18:              break;
19:           case "create" :
20:              checkIfLoggedIn();
21:              var url = this.href();
22:              this.checkAdd(usr, level);
23:              break;
24:        }
25:     } catch (deny) {
26:        res.message = deny.toString();
27:        res.redirect(url);
28:     }
29:     return;
30:  }