Queries the current driver to find out if it supports the given
capability.
public hasCapability ( string $capability ) : boolean | ||
$capability | string | The capability to test for. |
Résultat | boolean | Whether or not the capability is supported. |
/** * Returns a specific principal, specified by it's path. * * @param string $path * @return array */ public function getPrincipalByPath($path) { list($prefix, $user) = DAV\URLUtil::splitPath($path); if ($prefix != 'principals') { throw new DAV\Exception\NotFound('Invalid principal prefix path ' . $prefix); } if ($this->_auth->hasCapability('list') && !$this->_auth->exists($user) && $user != '-system-') { throw new DAV\Exception\NotFound('User ' . $user . ' does not exist'); } return $this->_getUserInfo($user); }
/** * Queries the current driver to find out if it supports the given * capability. * * @param string $capability The capability to test for. * * @return boolean Whether or not the capability is supported. */ public function hasCapability($capability) { if ($this->_base) { return $this->_base->hasCapability($capability); } // The follow capabilities are not determined by the Application, // but by 'Horde'. if (in_array(Horde_String::lower($capability), array('badlogincount', 'lock'))) { return parent::hasCapability($capability); } elseif (!isset($this->_appCapabilities)) { $this->_appCapabilities = $GLOBALS['registry']->getApiInstance($this->_app, 'application')->auth; } return in_array(Horde_String::lower($capability), $this->_appCapabilities); }
/** * Queries the current Auth object to find out if it supports the given * capability. * * @param string $capability The capability to test for. * * @return boolean Whether or not the capability is supported. */ public function hasCapability($capability) { if ($this->_params['lock']) { switch ($capability) { case 'add': case 'update': case 'resetpassword': case 'remove': return true; } } return parent::hasCapability($capability); }
/** */ public function hasCapability($capability) { return $this->_base->hasCapability($capability); }