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

tom authority #5

Open
akhsa234 opened this issue Jul 27, 2021 · 2 comments
Open

tom authority #5

akhsa234 opened this issue Jul 27, 2021 · 2 comments

Comments

@akhsa234
Copy link

I have a problem in
UserDetails tomUser = User.builder()
.username("tom")
.password(passwordEncoder.encode("password1234"))
// .roles(ADMINTRAINEE.name())//role adminTrainee
.authorities(ADMINTRAINEE.getGrantedAuthority()) //TODO it has problem as it can not post,put and delete??
.build();

when I check the tom
put, delete, and post methods return 200 status.
I check 3 times.

@jebjosh
Copy link

jebjosh commented Feb 25, 2022

did you find the solution? check to see your antMatcher sequence is correct

.antMatchers(HttpMethod.PUT,"/management/api/**").hasAuthority(COURSE_WRITE.getPermission())

i forgot to put the first slash in the beginning

@akhsa234
Copy link
Author

tnx. I changed it; therefore, I forgot what my problem was at that time.
I feel it worked properly, after some debugging.
tnx alot.

MSAlbalawi added a commit to MSAlbalawi/spring-boot-security-course that referenced this issue Oct 26, 2022
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

No branches or pull requests

2 participants