mirror of
https://github.com/OtusTeam/Spring.git
synced 2026-11-18 20:07:12 +00:00
Долг по SPeL к занятию 23
This commit is contained in:
1 parent
add322a397
commit
fa392112f9
1 file changed
+1
-1
@@ -6,7 +6,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class MyService {
|
||||
@PreAuthorize("hasRole('ROLE_USER')")
|
||||
@PreAuthorize("hasRole('ROLE_USER') && {new java.util.Random().nextInt()%2 == 0}")
|
||||
public String onlyUser() {
|
||||
return "My love";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user