8000 Show more information in the security profiler by javiereguiluz · Pull Request #17887 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Show more information in the security profiler #17887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
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
Prev Previous commit
Next Next commit
Made code more robust
  • Loading branch information
javiereguiluz committed Mar 2, 2016
commit 97111f3a68ba3a0eb0e7300f94d2f9fb7829e756
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Symfony\Component\Security\Core\Role\RoleInterface;
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Core\Authorization\DebugAccessDecisionManager;

/**
* SecurityDataCollector.
Expand Down Expand Up @@ -110,7 +111,7 @@ public function collect(Request $request, Response $response, \Exception $except
}

// collect voters and access decision manager information
if (null !== $this->accessDecisionManager) {
if ($this->accessDecisionManager instance of DebugAccessDecisionManager) {
$this->data['access_decision_log'] = $this->accessDecisionManager->getDecisionLog();
$this->data['voter_strategy'] = $this->accessDecisionManager->getStrategy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the getDecisionLog() and getStrategy() methods may not exist.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could typehint against the DebugAccessDecisionManager, good to let it crash if you run this incorrectly imo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made this change. Is this what you suggested?

-if (null !== $this->accessDecisionManager) {
+if ($this->accessDecisionManager instance of DebugAccessDecisionManager) {


Expand Down
0