Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 69a4fae

Browse files
[improve] Improved the PreAuth sample
1 parent e9d694c commit 69a4fae

File tree

1 file changed

+2
-1
lines changed
  • d03/d03s02-spring-security/src/main/java/net/safedata/spring/training/d03/s01/controller

1 file changed

+2
-1
lines changed

‎d03/d03s02-spring-security/src/main/java/net/safedata/spring/training/d03/s01/controller/ProductController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public class ProductController {
2929
@PreAuthorize(
3030
"hasRole('" + ADMIN_ROLE + "') " +
3131
"AND authentication.details.userAccount == 25 " + // an equality check
32-
"AND hasAuthority('WRITE')"
32+
"AND hasAuthority('ROLE_USER') " +
33+
"AND hasPermission('STOCKS', 'READ')"
3334
)
3435
public void addProduct(final Authentication authentication) {
3536
// further use the Authentication object, if needed

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /