Ignore:
Timestamp:
01/05/23 01:31:58 (18 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
676144b
Parents:
ab952ab
Message:

Added functionalities

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/autopartz/model/Deliveryman.java

    rab952ab r7d43957  
    2323public class Deliveryman extends User{
    2424    LocalDate employed_from;
     25    public static final LocalDate defaultEmployedFrom = LocalDate.of(2020,1,1);
     26
     27    public Deliveryman(String username, String name, String email, String password, String number) {
     28        super(username, name, email, password, number);
     29        this.employed_from = defaultEmployedFrom;
     30    }
    2531
    2632    @Override
     
    3844    @Override
    3945    public Collection<? extends GrantedAuthority> getAuthorities() {
    40         return Collections.singletonList(Role.ROLE_DELIVERYMAN);
     46        if(Objects.equals(employed_from, defaultEmployedFrom))
     47            return Collections.singletonList(Role.ROLE_PENDING_DELIVERYMAN);
     48        else
     49            return Collections.singletonList(Role.ROLE_DELIVERYMAN);
    4150    }
    4251}
Note: See TracChangeset for help on using the changeset viewer.