spring-projects / spring-projects/spring-hateoas
Integrate with SpringSecurity to consider authorization annotations on controller methods
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 476
- PR merge metrics
- No merged PRs in 30d
Description
Looking at the documentation I would like to use RepresentationModelProcessor to:
Leverage cross cutting services like Spring Security to add, remove, or revise links based upon the current user’s context.
Could it be possible to provide a sample for such a case ?
I.e.: if I have a service.create() method secured with @PreAuthorize("isMember(#id)") I would like to use the same logic to add/hide link to representation accordingly.
if necessary I can provide a sample project
Thanks
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start with the RepresentationModelProcessor section of the Spring HATEOAS documentation and the service.create() example using @PreAuthorize("isMember(#id)"). Define a sample that uses the current user’s authorization context to add or hide the corresponding representation link, then verify that the documentation explains the behavior and setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, documentation, security
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100