Skip to content
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

Security for all type "except entity" if has rol only hide menu #76

Merged
merged 7 commits into from
Nov 5, 2018
Merged

Security for all type "except entity" if has rol only hide menu #76

merged 7 commits into from
Nov 5, 2018

Conversation

gonzaloalonsod
Copy link
Contributor

Security for type "route" only hide menu

Security for type "route" only hide menu
Security for type "route" only hide menu
Security for type "route" only hide menu
@coveralls
Copy link

coveralls commented Nov 2, 2018

Coverage Status

Coverage decreased (-0.6%) to 90.066% when pulling eb04282 on gonzakpo:master into 02004ab on alterphp:master.

else if (
'route' === $entry['type']
&& isset($entry['role'])
&& !$this->adminAuthorizationChecker->isEasyAdminGranted(
Copy link
Owner

Choose a reason for hiding this comment

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

Please use Symfony security.authorization_checker service. AdminAuthorizationChecker is intended to check access regarding an entity EasyAdmin config. You can not invent a list action role to deal with this case.

Copy link
Owner

Choose a reason for hiding this comment

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

Adding a test to cover the use case would be really kindful too ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Necessary? Now it's very simple and uses authorizationChecker:

if (
    'route' === $entry['type']
    && isset($entry['role'])
    && !$this->authorizationChecker->isGranted($entry['role'])
)

@gonzaloalonsod gonzaloalonsod changed the title Security for type "route" only hide menu Security for all type if has rol only hide menu Nov 2, 2018
@gonzaloalonsod gonzaloalonsod changed the title Security for all type if has rol only hide menu Security for all type "except entity" if has rol only hide menu Nov 2, 2018
@alterphp alterphp merged commit 9a18dcb into alterphp:master Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants