Story.checkPost (usr, level)
check if user is allowed to post a comment to this story

  • Parameter Obj:
    Userobject
  • Parameter Int:
    Permission-Level
  • Returns
    String Reason for denial (or null if allowed)
Sourcecode in Story/securityFunctions.js:
1:   function checkPost(usr, level) {
2:      if (!usr.sysadmin && !this.site.online && level == null)
3:         throw new DenyException("siteView");
4:      else if (!this.site.preferences.getProperty("discussions"))
5:         throw new DenyException("siteNoDiscussion");
6:      else if (!this.discussions)
7:         throw new DenyException("storyNoDiscussion");
8:      return;
9:   }