Ignore:
Timestamp:
11/20/22 16:34:52 (2 years ago)
Author:
Marko <Marko@…>
Branches:
master
Parents:
ffd50db
Message:

Final features implemented

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  
    7878    }
    7979
     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
    8087    @Override
    8188    public Collection<? extends GrantedAuthority> getAuthorities() {
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/security/configs/WebSecurityConfig.java

    rffd50db r47f4eaf  
    55import finki.it.phoneluxbackend.services.UserService;
    66import lombok.AllArgsConstructor;
     7import org.springframework.beans.factory.annotation.Autowired;
    78import org.springframework.context.annotation.Bean;
    89import org.springframework.context.annotation.Configuration;
     
    1718import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
    1819
    19 import static org.springframework.http.HttpMethod.GET;
    20 
    2120@Configuration
    2221@AllArgsConstructor
     
    2625    private final UserService userService;
    2726    private final BCryptPasswordEncoder bCryptPasswordEncoder;
    28 
    2927    @Override
    3028    protected void configure(HttpSecurity http) throws Exception {
     
    4745                .antMatchers("/admin/**")
    4846                .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()
    4957                .anyRequest().permitAll();
    50 
    5158
    5259
     
    5562
    5663    }
     64
    5765
    5866    @Override
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/RegistrationService.java

    rffd50db r47f4eaf  
    11package finki.it.phoneluxbackend.services;
    22
    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;
    73import finki.it.phoneluxbackend.data.RegistrationRequest;
    84import finki.it.phoneluxbackend.data.UserRole;
     
    128import finki.it.phoneluxbackend.security.email.EmailValidator;
    139import lombok.AllArgsConstructor;
    14 import org.apache.coyote.Response;
    15 import org.apache.tomcat.util.json.JSONParser;
    1610import org.springframework.http.HttpStatus;
    1711import org.springframework.http.ResponseEntity;
     
    2014
    2115import java.time.LocalDateTime;
    22 import java.util.HashMap;
    2316
    2417@Service
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/UserService.java

    rffd50db r47f4eaf  
    4141    }
    4242
     43
     44
    4345    public ResponseEntity<Object> signUpUser(User user)
    4446    {
Note: See TracChangeset for help on using the changeset viewer.