- 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/Warehouseman.java
rab952ab r7d43957 23 23 public class Warehouseman extends User{ 24 24 LocalDate employed_from; 25 public static final LocalDate defaultEmployedFrom = LocalDate.of(2020,1,1); 25 26 @ManyToOne 26 27 @JoinColumn(name = "id_warehouse") 27 28 Warehouse warehouse; 29 30 public Warehouseman(String username, String name, String email, String password, String number, Warehouse warehouse) { 31 super(username, name, email, password, number); 32 this.employed_from=defaultEmployedFrom; 33 this.warehouse= warehouse; 34 } 28 35 29 36 @Override … … 41 48 @Override 42 49 public Collection<? extends GrantedAuthority> getAuthorities() { 43 return Collections.singletonList(Role.ROLE_WAREHOUSEMAN); 50 if(employed_from==defaultEmployedFrom) 51 return Collections.singletonList(Role.ROLE_PENDING_WAREHOUSEMAN); 52 else 53 return Collections.singletonList(Role.ROLE_WAREHOUSEMAN); 44 54 } 45 55 }
Note:
See TracChangeset
for help on using the changeset viewer.