hasCapability() 공개 메소드

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.
리턴 boolean Whether or not the capability is supported.
예제 #1
0
 /**
  * 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);
 }
예제 #2
0
파일: Application.php 프로젝트: horde/horde
 /**
  * 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);
 }
예제 #3
0
파일: Passwd.php 프로젝트: raz0rsdge/horde
 /**
  * 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);
 }
예제 #4
0
 /**
  */
 public function hasCapability($capability)
 {
     return $this->_base->hasCapability($capability);
 }