Changeset 47f4eaf for phonelux-backend/src/main/java/finki
- Timestamp:
- 11/20/22 16:34:52 (2 years ago)
- Branches:
- master
- Parents:
- ffd50db
- Location:
- phonelux-backend/src/main/java/finki/it/phoneluxbackend
- Files:
-
- 8 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/User.java
rffd50db r47f4eaf 78 78 } 79 79 80 public User(String firstName, String lastName, String email, UserRole userRole) { 81 this.firstName = firstName; 82 this.lastName = lastName; 83 this.email = email; 84 this.userRole = userRole; 85 } 86 80 87 @Override 81 88 public Collection<? extends GrantedAuthority> getAuthorities() { -
phonelux-backend/src/main/java/finki/it/phoneluxbackend/security/configs/WebSecurityConfig.java
rffd50db r47f4eaf 5 5 import finki.it.phoneluxbackend.services.UserService; 6 6 import lombok.AllArgsConstructor; 7 import org.springframework.beans.factory.annotation.Autowired; 7 8 import org.springframework.context.annotation.Bean; 8 9 import org.springframework.context.annotation.Configuration; … … 17 18 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; 18 19 19 import static org.springframework.http.HttpMethod.GET;20 21 20 @Configuration 22 21 @AllArgsConstructor … … 26 25 private final UserService userService; 27 26 private final BCryptPasswordEncoder bCryptPasswordEncoder; 28 29 27 @Override 30 28 protected void configure(HttpSecurity http) throws Exception { … … 47 45 .antMatchers("/admin/**") 48 46 .hasAnyAuthority("ADMIN","SUPERADMIN") 47 .and() 48 .authorizeRequests() 49 .antMatchers("/offerreport/**") 50 .hasAnyAuthority("USER", "ADMIN", "SUPERADMIN") 51 .and() 52 .authorizeRequests() 53 .antMatchers("/scrapperinfo/**") 54 .hasAnyAuthority("SUPERADMIN") 55 .and() 56 .authorizeRequests() 49 57 .anyRequest().permitAll(); 50 51 58 52 59 … … 55 62 56 63 } 64 57 65 58 66 @Override -
phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/RegistrationService.java
rffd50db r47f4eaf 1 1 package finki.it.phoneluxbackend.services; 2 2 3 import com.fasterxml.jackson.core.JsonParser;4 import com.fasterxml.jackson.core.io.JsonStringEncoder;5 import com.fasterxml.jackson.databind.ObjectMapper;6 import com.fasterxml.jackson.databind.util.JSONPObject;7 3 import finki.it.phoneluxbackend.data.RegistrationRequest; 8 4 import finki.it.phoneluxbackend.data.UserRole; … … 12 8 import finki.it.phoneluxbackend.security.email.EmailValidator; 13 9 import lombok.AllArgsConstructor; 14 import org.apache.coyote.Response;15 import org.apache.tomcat.util.json.JSONParser;16 10 import org.springframework.http.HttpStatus; 17 11 import org.springframework.http.ResponseEntity; … … 20 14 21 15 import java.time.LocalDateTime; 22 import java.util.HashMap;23 16 24 17 @Service -
phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/UserService.java
rffd50db r47f4eaf 41 41 } 42 42 43 44 43 45 public ResponseEntity<Object> signUpUser(User user) 44 46 {
Note:
See TracChangeset
for help on using the changeset viewer.