Skip to content

Commit 647ca1c

Browse files
author
fnkbsi
committed
SecurityConfiguration: adapt SecurityFilterChain, so Usesr have "read"
but no "write" access
1 parent 040878c commit 647ca1c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/main/java/de/rwth/idsg/steve/config/SecurityConfiguration.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,27 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
101101
.authorizeRequests(
102102
req -> req
103103
.antMatchers(prefix + "/home").hasAnyRole("USER", "ADMIN")
104-
.antMatchers(prefix + "/users/" + "**").hasAnyRole("USER", "ADMIN")
105-
.antMatchers(prefix + "/ocppTags/" + "**").hasAnyRole("USER", "ADMIN")
104+
// webuser
105+
.antMatchers(prefix + "/webusers").hasAnyRole("USER", "ADMIN")
106+
.antMatchers(prefix + "/webusers" + "/details/**").hasAnyRole("USER", "ADMIN")
107+
// users
108+
.antMatchers(prefix + "/users").hasAnyRole("USER", "ADMIN")
109+
.antMatchers(prefix + "/users" + "/details/**").hasAnyRole("USER", "ADMIN")
110+
//ocppTags
111+
.antMatchers(prefix + "/ocppTags").hasAnyRole("USER", "ADMIN")
112+
.antMatchers(prefix + "/ocppTags" + "/details/**").hasAnyRole("USER", "ADMIN")
113+
// chargepoints
114+
.antMatchers(prefix + "/chargepoints").hasAnyRole("USER", "ADMIN")
115+
.antMatchers(prefix + "/chargepoints" + "/details/**").hasAnyRole("USER", "ADMIN")
116+
// transactions and reservations
117+
.antMatchers(prefix + "/transactions").hasAnyRole("USER", "ADMIN")
118+
.antMatchers(prefix + "/transactions" + "/details/**").hasAnyRole("USER", "ADMIN")
119+
.antMatchers(prefix + "/reservations").hasAnyRole("USER", "ADMIN")
120+
.antMatchers(prefix + "/reservations" + "/**").hasRole("ADMIN")
121+
// singout and noAccess
106122
.antMatchers(prefix + "/signout/" + "**").hasAnyRole("USER", "ADMIN")
107123
.antMatchers(prefix + "/noAccess/" + "**").hasAnyRole("USER", "ADMIN")
124+
// any other site
108125
.antMatchers(prefix + "/**").hasRole("ADMIN")
109126
)
110127
.sessionManagement(

0 commit comments

Comments
 (0)