Skip to content

#200 - UserCrudController: reserve the generateToken action to ROLE_ADMIN - #201

Open
njoubert-cleverage wants to merge 1 commit into
mainfrom
200
Open

njoubert-cleverage wants to merge 1 commit into
mainfrom
200

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #200.

generateToken() gets #[IsGranted('ROLE_ADMIN')], the permission of the users (setEntityPermission(), applied by EasyAdmin to its built-in actions only), and answers 404 when the user is not found. A ROLE_USER now gets a 403 instead of a 500 (setToken() on null).

The CSRF protection of this action is #115 / #116 (v4.0): #116 will need a trivial rebase on this change.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None.

🤖 Generated with Claude Code

…DMIN, 404 for an unknown user

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

UserCrudController: the generateToken action has no access control of its own

1 participant