- Timestamp:
- 01/05/23 01:31:58 (23 months ago)
- Branches:
- main
- Children:
- 676144b
- Parents:
- ab952ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/model/Deliveryman.java
rab952ab r7d43957 23 23 public class Deliveryman extends User{ 24 24 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 } 25 31 26 32 @Override … … 38 44 @Override 39 45 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); 41 50 } 42 51 }
Note:
See TracChangeset
for help on using the changeset viewer.