LeNelSoN / you-are-the-hero

L'API dont vous êtes le héros is an interactive Java API that brings the adventure of "choose your own adventure" stories to life. Users can embark on unique journeys, make decisions at each step, and create dynamic narratives, all while experiencing the nostalgia of classic adventure books.
GNU General Public License v3.0
2 stars 10 forks source link

Feat(27): storysecurisation #32

Closed padabou closed 1 month ago

padabou commented 2 months ago

[X] Update the story creation endpoint to check if the user has the "Editor" role before allowing story creation. 🔒 [X] Update the story modification endpoint to enforce the same role restriction, ensuring only editors can modify existing stories. [X] Implement role checks in the relevant service classes to verify the user's permissions. [X] Write unit tests to validate that only users with the "Editor" role can create or modify stories, and that appropriate error messages are returned for unauthorized attempts.

Rely on : https://github.com/LeNelSoN/you-are-the-hero/issues/27