/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Auth
NameSizeModeActions
Storage/-0755rm
AbstractPasswordHasher.php23920644editdlrm
BaseAuthenticate.php91660644editdlrm
BaseAuthorize.php19140644editdlrm
BasicAuthenticate.php42480644editdlrm
ControllerAuthorize.php30310644editdlrm
DefaultPasswordHasher.php27550644editdlrm
DigestAuthenticate.php101300644editdlrm
FallbackPasswordHasher.php32040644editdlrm
FormAuthenticate.php32240644editdlrm
PasswordHasherFactory.php20590644editdlrm
WeakPasswordHasher.php19820644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Auth/ControllerAuthorize.php (3031B)
request->getParam('admin')) { * return $user['role'] === 'admin'; * } * return !empty($user); * } * ``` * * The above is simple implementation that would only authorize users of the * 'admin' role to access admin routing. * * @see \Cake\Controller\Component\AuthComponent::$authenticate */ class ControllerAuthorize extends BaseAuthorize { /** * Controller for the request. * * @var \Cake\Controller\Controller */ protected $_Controller; /** * @inheritDoc */ public function __construct(ComponentRegistry $registry, array $config = []) { parent::__construct($registry, $config); $this->controller($registry->getController()); } /** * Get/set the controller this authorize object will be working with. Also * checks that isAuthorized is implemented. * * @param \Cake\Controller\Controller|null $controller null to get, a controller to set. * @return \Cake\Controller\Controller */ public function controller(?Controller $controller = null): Controller { if ($controller) { $this->_Controller = $controller; } return $this->_Controller; } /** * Checks user authorization using a controller callback. * * @param \ArrayAccess|array $user Active user data * @param \Cake\Http\ServerRequest $request Request instance. * @throws \Cake\Core\Exception\CakeException If controller does not have method `isAuthorized()`. * @return bool */ public function authorize($user, ServerRequest $request): bool { if (!method_exists($this->_Controller, 'isAuthorized')) { throw new CakeException(sprintf( '%s does not implement an isAuthorized() method.', get_class($this->_Controller) )); } return (bool)$this->_Controller->isAuthorized($user); } }