mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 23:05:26 +02:00
fix(endpointgroups): add transactions support to the User model to avoid a nil pointer dereference EE-5328 (#9221)
This commit is contained in:
parent
7acd1080ad
commit
9fa097d45f
3 changed files with 80 additions and 3 deletions
|
@ -32,6 +32,16 @@ func NewService(connection portainer.Connection) (*Service, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (service *Service) Tx(tx portainer.Transaction) ServiceTx {
|
||||
return ServiceTx{
|
||||
BaseDataServiceTx: dataservices.BaseDataServiceTx[portainer.User, portainer.UserID]{
|
||||
Bucket: BucketName,
|
||||
Connection: service.Connection,
|
||||
Tx: tx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// UserByUsername returns a user by username.
|
||||
func (service *Service) UserByUsername(username string) (*portainer.User, error) {
|
||||
var u portainer.User
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue