lista_utenti: handle rappresentanti in :auth:
This commit is contained in:
@@ -9,7 +9,8 @@ import (
|
|||||||
type authListaUtenti struct {
|
type authListaUtenti struct {
|
||||||
AuthService auth.Service
|
AuthService auth.Service
|
||||||
|
|
||||||
Macchinisti util.Set[string]
|
Macchinisti util.Set[string]
|
||||||
|
Rappresentanti util.Set[string]
|
||||||
}
|
}
|
||||||
|
|
||||||
func newAuthListaUtenti(authService auth.Service) (Service, error) {
|
func newAuthListaUtenti(authService auth.Service) (Service, error) {
|
||||||
@@ -18,7 +19,12 @@ func newAuthListaUtenti(authService auth.Service) (Service, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &authListaUtenti{authService, macchinisti}, nil
|
rappresentanti, err := loadRappresentanti()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &authListaUtenti{authService, macchinisti, rappresentanti}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *authListaUtenti) GetUtenti() ([]*model.ListUser, error) {
|
func (a *authListaUtenti) GetUtenti() ([]*model.ListUser, error) {
|
||||||
@@ -38,6 +44,7 @@ func (a *authListaUtenti) GetUtenti() ([]*model.ListUser, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mergeMacchinisti(users, a.Macchinisti)
|
mergeMacchinisti(users, a.Macchinisti)
|
||||||
|
mergeRappresentanti(users, a.Macchinisti)
|
||||||
|
|
||||||
return users, nil
|
return users, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ func newJsonListaUtenti(path string) (Service, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
rappresentanti, err := loadRappresentanti()
|
rappresentanti, err := loadRappresentanti()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user