Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs example uses access(String) with authorizeHttpRequests() #11280

Closed
vbezhenar opened this issue May 25, 2022 · 1 comment
Closed

Docs example uses access(String) with authorizeHttpRequests() #11280

vbezhenar opened this issue May 25, 2022 · 1 comment
Assignees
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Milestone

Comments

@vbezhenar
Copy link

Documentation (Example 2) states that it's possible to write

http.authorizeHttpRequests(authorize ->
    authorize.mvcMatchers("/db/**").access("hasRole('ADMIN') and hasRole('DBA')")

but there's no access(String) method.

Here's my SO question with background information: https://stackoverflow.com/questions/72366267/matching-ip-address-with-authorizehttprequests

I'm using Spring Security 5.7.1.

@vbezhenar vbezhenar added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels May 25, 2022
@sjohnr sjohnr changed the title Invalid documentation Docs example uses authorizeHttpRequests().access(String) May 26, 2022
@sjohnr sjohnr changed the title Docs example uses authorizeHttpRequests().access(String) Docs example uses authorizeHttpRequests().mvcMatchers().access(String) May 26, 2022
@sjohnr sjohnr changed the title Docs example uses authorizeHttpRequests().mvcMatchers().access(String) Docs example uses access(String) with authorizeHttpRequests() May 26, 2022
@sjohnr
Copy link
Member

sjohnr commented May 26, 2022

Hi @vbezhenar, thanks for reporting this issue! Typically, you don't need to cross-post, but I see that a community member recommended that you open an issue. We can use this issue to fix the docs, as indeed it appears to be an issue with the docs. I've submitted an answer to your question as an example of how to build your own expressions.

@sjohnr sjohnr added in: docs An issue in Documentation or samples and removed status: waiting-for-triage An issue we've not yet triaged labels May 26, 2022
@sjohnr sjohnr modified the milestones: 5.7.x, 5.8.x May 26, 2022
jzheaux added a commit that referenced this issue May 27, 2022
@jzheaux jzheaux modified the milestones: 5.8.x, 6.0.0-M6 May 27, 2022
jzheaux added a commit that referenced this issue May 27, 2022
@jzheaux jzheaux self-assigned this May 27, 2022
jzheaux added a commit that referenced this issue May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants