IMP_Imap::access PHP Method

access() public method

Checks access rights for a server.
public access ( integer $right ) : boolean
$right integer Access right.
return boolean Does the access right exist?
    public function access($right)
    {
        global $injector;
        if (!$this->init) {
            return false;
        }
        switch ($right) {
            case self::ACCESS_ACL:
                return $this->config->acl && $this->queryCapability('ACL');
            case self::ACCESS_CREATEMBOX:
                return $this->isImap() && $injector->getInstance('Horde_Core_Perms')->hasAppPermission($this->_getPerm('create_mboxes'));
            case self::ACCESS_CREATEMBOX_MAX:
                return $this->isImap() && $injector->getInstance('Horde_Core_Perms')->hasAppPermission($this->_getPerm('max_create_mboxes'));
            case self::ACCESS_DRAFTS:
            case self::ACCESS_FLAGS:
            case self::ACCESS_IMPORT:
            case self::ACCESS_SEARCH:
            case self::ACCESS_UNSEEN:
                return $this->isImap();
            case self::ACCESS_FOLDERS:
            case self::ACCESS_TRASH:
                return $this->isImap() && $injector->getInstance('Horde_Core_Perms')->hasAppPermission($this->_getPerm('allow_folders'));
            case self::ACCESS_REMOTE:
                return $injector->getInstance('Horde_Core_Perms')->hasAppPermission($this->_getPerm('allow_remote'));
            case self::ACCESS_SORT:
                return $this->isImap() && ($this->config->sort_force || $this->_ob->queryCapability('SORT'));
        }
        return false;
    }