Add security to demo
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- authorization, backend, security
Research direction
Start by reviewing the demo's current dashboard permission setup and its User, Post, and Comment voter entry points. Compare the requested ROLE_ADMIN, record-owner, and edit permissions with the existing configuration, then verify that the demo demonstrates the intended behavior and explains whether voters or the expression language are used.
Written by the indexing model from the issue text.
Description
I quite like the demo for seeing "Best Practices" of now to configure EasyAdmin, thanks for releasing it and the package itself.
I think it'd be great to see the demo with a more complete security setup. What I'd like to see is
- Anyone can view the dashboard, subject to the ->setPermission()
- ROLE_ADMIN can do anything
- USER_EDIT permissions are granted for ROLE_ADMIN and when the user record email matches the logged in user's email.
- POST_EDIT -- only ROLE_ADMIN and POST_EDIT
- COMMENT_EDIT -- configure COMMENT_EDIT in CommentVoter to be ROLE_ADMIN or comment->getUser->getEmail === $user->getEmail()
At least that's the way I'm configuring my voters. Perhaps there's a better way?
It's possible that using the expression language is sufficient and and the Voter is overkill, though I quite like the Symfony Voter system, and of course it integrates beautifully with EasyAdmin.
Mostly I'm looking for more examples and best practices.
Thanks.
- Dominant language
- PHP
- Stars
- 18
- Forks
- 9
- Avg merge
- 4h 35m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EasyCorp/easyadmin-demo
-
Public deploymentOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
EasyCorp/easyadmin-demo#6 · 1 comment · 1 reaction ·
All issues in EasyCorp/easyadmin-demo
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
taskforcesh/bullmq#5238 ·
Maintainers usually reply within 1 day
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itPossibly taken @bfs2021 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/jetpack#55517 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
area/import type/enhancement when/later
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day