Пример #1
0
 /** Clears all existing permissions. Needed primarily in test.
  *
  * 	@param	int		optional usergroup
  *
  **/
 public function clearChannelPermissions($usergroupid = false)
 {
     $this->permissionContext->clearChannelPermissions($usergroupid);
     $this->canModerate = false;
     $this->canRead = false;
     $this->cantRead = false;
     $this->noComments = array();
     $this->canCreateTypes = array();
     $this->canPost = array();
     $this->channelAccess = false;
     $this->globalPerms = false;
     $this->reloadUserPerms(true);
     $this->superMod = array('moderatorpermissions' => 0, 'moderatorpermissions2' => 0);
     $this->channelPermsFrom = vB::getDatastore()->getValue('vBUgChannelPermissionsFrom');
     vB::getCurrentSession()->clearChannelPerms();
     //Add any permissions from the moderator table.
     if ($this->userid) {
         $this->moderatorPerms = vB_Library::instance('user')->fetchModerator($this->userid);
     } else {
         $this->moderatorPerms = array();
     }
 }