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
Minor refactoring
  • Loading branch information
javiereguiluz committed Feb 29, 2016
commit 5e46d238ec4747db6f05cb3e51ca663ce4cab289
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,19 @@ public function collect(Request $request, Response $response, \Exception $except
}

// collect voters and access decision manager information
$this->data['access_decision_log'] = array();
$this->data['voter_strategy'] = 'unknown';
$this->data['voters'] = array();

if (null !== $this->accessDecisionManager) {
$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) {

}

if (!empty($this->accessDecisionManager->getVoters())) {
foreach ($this->accessDecisionManager->getVoters() as $voter) {
$this->data['voters'][] = get_class($voter);
}

$this->data['access_decision_log'] = $this->accessDecisionManager->getDecisionLog();
} else {
$this->data['voter_strategy'] = 'unknown';
$this->data['voters'] = array();
$this->data['access_decision_log'] = array();
}
}

Expand Down
0