Skip to content

Commit 216cdcf

Browse files
committed
update files
1 parent e137057 commit 216cdcf

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

backend/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
<groupId>org.springframework.boot</groupId>
4242
<artifactId>spring-boot-starter-data-jpa</artifactId>
4343
</dependency>
44-
<dependency>
44+
<!--dependency>
4545
<groupId>org.postgresql</groupId>
4646
<artifactId>postgresql</artifactId>
47-
</dependency>
48-
<!--dependency>
47+
</dependency-->
48+
<dependency>
4949
<groupId>com.h2database</groupId>
5050
<artifactId>h2</artifactId>
5151
<version>2.1.210</version>
52-
</dependency-->
52+
</dependency>
5353
<dependency>
5454
<groupId>org.springframework.boot</groupId>
5555
<artifactId>spring-boot-starter-test</artifactId>

backend/src/main/java/webapp3/webapp3/security/RestSecurityConfiguration.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,22 @@ protected void configure(HttpSecurity http) throws Exception {
6969

7070
http.authorizeRequests().antMatchers(HttpMethod.DELETE, "/api/users/**").hasRole("administrator");
7171

72-
//monitor
73-
http.authorizeRequests().antMatchers(HttpMethod.GET, "/api/users/monitors/me").hasRole("monitor");
72+
7473

7574
http.authorizeRequests().antMatchers(HttpMethod.PUT, "/api/users/me").hasRole("monitor");
7675
http.authorizeRequests().antMatchers(HttpMethod.PUT, "/api/users/me/image/").hasRole("monitor");
7776
http.authorizeRequests().antMatchers(HttpMethod.PUT, "/api/users/monitors/{id}/image/").hasRole("monitor");
7877

7978
//member
80-
http.authorizeRequests().antMatchers(HttpMethod.GET, "/api/users/members/me").hasRole("monitor");
79+
http.authorizeRequests().antMatchers(HttpMethod.GET, "/api/users/members/me").hasRole("member");
8180
http.authorizeRequests().antMatchers(HttpMethod.GET, "/api/users/members/statistics").hasRole("member");
8281

8382
http.authorizeRequests().antMatchers(HttpMethod.PUT, "/api/users/me").hasRole("member");
8483
http.authorizeRequests().antMatchers(HttpMethod.PUT, "/api/users/me/image/").hasRole("member");
8584

85+
//monitor
86+
http.authorizeRequests().antMatchers(HttpMethod.GET, "/api/users/monitors/me").hasRole("monitor");
87+
8688
//exercise
8789
//http.authorizeRequests().antMatchers(HttpMethod.GET,"/api/exercises/").hasRole("monitor");
8890

backend/src/main/resources/application.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
spring.mustache.suffix=.html
22
logging.level.org.springframework.web=DEBUG
33
spring.h2.console.enabled=true
4-
#spring.datasource.url=jdbc:h2:mem:testdb
4+
spring.datasource.url=jdbc:h2:mem:testdb
55

66

77
spring.jpa.properties.hibernate.format_sql=true
@@ -17,7 +17,7 @@ server.ssl.key-store= classpath:keystore.jks
1717
server.ssl.key-store-password= password
1818
server.ssl.key-password= secret
1919

20-
spring.datasource.url=jdbc:postgresql://localhost/posts
20+
#spring.datasource.url=jdbc:postgresql://localhost/posts
2121
spring.datasource.username=postgres
2222
spring.datasource.password=password
2323
spring.jpa.hibernate.ddl-auto=create-drop

0 commit comments

Comments
 (0)