Skip to content

Commit 8c81e89

Browse files
committed
Allow debug mode by default.
1 parent 3702de8 commit 8c81e89

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ working correctly. Some common problems are:
4545
itself to protect a potentially non-development environment.
4646
3. If you are using the [Authorization Plugin](https://github.com/cakephp/authorization)
4747
you need to set `DebugKit.ignoreAuthorization` to `true` in your config.
48+
Not needed anymore for DebugKit 5.3.0+.
4849

4950
## Reporting Issues
5051

docs/en/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ Configuration
6262
// Ignore image paths
6363
Configure::write('DebugKit.ignorePathsPattern', '/\.(jpg|png|gif)$/');
6464

65-
* ``DebugKit.ignoreAuthorization`` - Set to true to ignore Cake Authorization plugin for DebugKit requests. Disabled by default.
65+
* ``DebugKit.ignoreAuthorization`` - Set to true to ignore Cake Authorization plugin for DebugKit requests.
66+
Not needed anymore for DebugKit 5.3.0+.
6667

6768
* ``DebugKit.maxDepth`` - Defines how many levels of nested data should be shown in general for debug output. Default is 5.
6869
WARNING: Increasing the max depth level can lead to an out of memory error.::

src/Controller/DebugKitController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function beforeFilter(EventInterface $event): void
4343
// ignore it, only if `DebugKit.ignoreAuthorization` is set to true
4444
$authorizationService = $this->getRequest()->getAttribute('authorization');
4545
if ($authorizationService instanceof AuthorizationService) {
46-
if (Configure::read('DebugKit.ignoreAuthorization')) {
46+
if (Configure::read('DebugKit.ignoreAuthorization') || Configure::read('debug')) {
4747
$authorizationService->skipAuthorization();
4848
} else {
4949
Log::info(

tests/TestCase/Controller/DebugKitControllerTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,6 @@ private function _buildController()
6666
return new DebugKitController($request);
6767
}
6868

69-
/**
70-
* tests authorization is enabled but not ignored
71-
*
72-
* @return void
73-
*/
74-
public function testDontIgnoreAuthorization()
75-
{
76-
$controller = $this->_buildController();
77-
$event = new Event('testing');
78-
$controller->beforeFilter($event);
79-
80-
$this->assertFalse($controller->getRequest()->getAttribute('authorization')->authorizationChecked());
81-
}
82-
8369
/**
8470
* tests authorization is checked to avoid
8571
* AuthorizationRequiredException throwned

0 commit comments

Comments
 (0)