Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow debug mode by default.
  • Loading branch information
dereuromark committed Nov 14, 2025
commit 8c81e89e3e000b422f7dc2addaabb5023d442b79
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ working correctly. Some common problems are:
itself to protect a potentially non-development environment.
3. If you are using the [Authorization Plugin](https://github.com/cakephp/authorization)
you need to set `DebugKit.ignoreAuthorization` to `true` in your config.
Not needed anymore for DebugKit 5.3.0+.

## Reporting Issues

Expand Down
3 changes: 2 additions & 1 deletion docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Configuration
// Ignore image paths
Configure::write('DebugKit.ignorePathsPattern', '/\.(jpg|png|gif)$/');

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

* ``DebugKit.maxDepth`` - Defines how many levels of nested data should be shown in general for debug output. Default is 5.
WARNING: Increasing the max depth level can lead to an out of memory error.::
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/DebugKitController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// ignore it, only if `DebugKit.ignoreAuthorization` is set to true
$authorizationService = $this->getRequest()->getAttribute('authorization');
if ($authorizationService instanceof AuthorizationService) {
if (Configure::read('DebugKit.ignoreAuthorization')) {
if (Configure::read('DebugKit.ignoreAuthorization') || Configure::read('debug')) {

Check failure on line 46 in src/Controller/DebugKitController.php

View workflow job for this annotation

GitHub Actions / cs-stan / Coding Standard & Static Analysis

Right side of || is always true.
$authorizationService->skipAuthorization();
} else {
Log::info(
Expand Down
14 changes: 0 additions & 14 deletions tests/TestCase/Controller/DebugKitControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,6 @@ private function _buildController()
return new DebugKitController($request);
}

/**
* tests authorization is enabled but not ignored
*
* @return void
*/
public function testDontIgnoreAuthorization()
{
$controller = $this->_buildController();
$event = new Event('testing');
$controller->beforeFilter($event);

$this->assertFalse($controller->getRequest()->getAttribute('authorization')->authorizationChecked());
}

/**
* tests authorization is checked to avoid
* AuthorizationRequiredException throwned
Expand Down
Loading