Esempio n. 1
0
 /**
  * Performs access check for this user.
  * @param string $operation the name of the operation that need access check.
  * @param array $params name-value pairs that would be passed to business rules associated
  * with the tasks and roles assigned to the user.
  * @param boolean $allowCaching whether to allow caching the result of access check.
  * @return boolean whether the operations can be performed by this user.
  */
 public function checkAccess($operation, $params = array(), $allowCaching = true)
 {
     if ($this->getIsAdmin()) {
         return true;
     }
     return parent::checkAccess($operation, $params, $allowCaching);
 }
 /**
  * Performs access check for this user.
  * Overloads the parent method in order to allow superusers access implicitly.
  * @param string the name of the operation that need access check.
  * @param array name-value pairs that would be passed to business rules associated
  * with the tasks and roles assigned to the user.
  * @param boolean whether to allow caching the result of access checki.
  * This parameter has been available since version 1.0.5. When this parameter
  * is true (default), if the access check of an operation was performed before,
  * its result will be directly returned when calling this method to check the same operation.
  * If this parameter is false, this method will always call {@link CAuthManager::checkAccess}
  * to obtain the up-to-date access result. Note that this caching is effective
  * only within the same request.
  * @return boolean whether the operations can be performed by this user.
  */
 public function checkAccess($operation, $params = array(), $allowCaching = true)
 {
     // Allow superusers access implicitly and do CWebUser::checkAccess for others.
     return $this->isSuperuser === true ? true : parent::checkAccess($operation, $params, $allowCaching);
 }