marianodonal

Results 7 comments of marianodonal

Initialize on AppController.php (non-prefixed) ``` $this->loadComponent('RequestHandler'); $this->loadComponent('Flash'); $this->loadComponent('FormProtection', [ 'validationFailureCallback' => function (BadRequestException $exception) { $this->Flash->error(__('Something went wrong... Please refresh the page.'), ['escape' => false]); return $this->redirect( $this->request->referer() ); }...

@dereuromark, have you found anything or do you have any ideas to fix this problem? Thanks in advance

Ok, I'll try. Something to keep in mind is that I am using it with the Authentication and Authorization plugins.

I think I found something. In AllowTrait.php: ``` protected function _getAllowRule(array $params) { $rules = $this->_getAllow($this->getConfig('allowFilePath')); $allowDefaults = $this->_getAllowDefaultsForCurrentParams($params); foreach ($rules as $rule) { if ($params['plugin'] && $params['plugin'] !== $rule['plugin'])...

This resolves this particular scenario. Maybe we need to run some tests. Is there a scenario like plugin key or any other key is not present?

Another way is to fill missing keys in params before send to "_getAllowRule()". In AuthenticationComponent.php there is a "_prepareAuthentication()" function, maybe we can fill missing params there before calling _getAllowRule()....

And this for _getAllowRule() ``` protected function _getAllowRule(array $params) { $rules = $this->_getAllow($this->getConfig('allowFilePath')); $allowDefaults = $this->_getAllowDefaultsForCurrentParams($params); foreach ($rules as $rule) { if ( isset($params['plugin']) && !is_null($params['plugin']) ) { if ($params['plugin']...