spring-projects / spring-projects/spring-hateoas

Integrate with SpringSecurity to consider authorization annotations on controller methods

Open
#1,343 6 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.