mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
dataprovider: add timestamp fields for users and admins
This commit is contained in:
@@ -1058,6 +1058,11 @@ func checkAdmin(expected, actual *dataprovider.Admin) error {
|
||||
return errors.New("admin ID mismatch")
|
||||
}
|
||||
}
|
||||
if expected.CreatedAt > 0 {
|
||||
if expected.CreatedAt != actual.CreatedAt {
|
||||
return fmt.Errorf("created_at mismatch %v != %v", expected.CreatedAt, actual.CreatedAt)
|
||||
}
|
||||
}
|
||||
if err := compareAdminEqualFields(expected, actual); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1116,6 +1121,11 @@ func checkUser(expected *dataprovider.User, actual *dataprovider.User) error {
|
||||
return errors.New("user ID mismatch")
|
||||
}
|
||||
}
|
||||
if expected.CreatedAt > 0 {
|
||||
if expected.CreatedAt != actual.CreatedAt {
|
||||
return fmt.Errorf("created_at mismatch %v != %v", expected.CreatedAt, actual.CreatedAt)
|
||||
}
|
||||
}
|
||||
if len(expected.Permissions) != len(actual.Permissions) {
|
||||
return errors.New("permissions mismatch")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user