Skip to content
Snippets Groups Projects
Commit 8b38c20d authored by Fabian Seidl's avatar Fabian Seidl
Browse files

Hotfix update issue with memory store

See merge request !304
parent d3aeea56
No related branches found
No related tags found
2 merge requests!304Hotfix update issue with memory store,!264WIP: Develop
Pipeline #100700 passed
...@@ -620,6 +620,7 @@ func TestAuth_UpdateRoles(t *testing.T) { ...@@ -620,6 +620,7 @@ func TestAuth_UpdateRoles(t *testing.T) {
} }
func TestAuth_DeletePermissionsForRole(t *testing.T) { func TestAuth_DeletePermissionsForRole(t *testing.T) {
clearAndCreateAuthTestSetup()
type args struct { type args struct {
ctx context.Context ctx context.Context
request *apb.DeletePermissionsForRoleRequest request *apb.DeletePermissionsForRoleRequest
......
...@@ -49,8 +49,8 @@ func (t *MemoryDeviceStore) Add(item device.Device) error { ...@@ -49,8 +49,8 @@ func (t *MemoryDeviceStore) Add(item device.Device) error {
// Update updates a existing device. // Update updates a existing device.
func (t *MemoryDeviceStore) Update(item device.Device) error { func (t *MemoryDeviceStore) Update(item device.Device) error {
_, ok := t.Store[item.ID().String()] _, ok := t.Store[item.ID().String()]
if ok { if !ok {
return nil return errors.ErrCouldNotFind{StoreName: deviceStoreName}
} }
var device device.LoadedDevice var device device.LoadedDevice
......
...@@ -55,8 +55,8 @@ func (s *MemoryRoleStore) Delete(item rbac.Role) error { ...@@ -55,8 +55,8 @@ func (s *MemoryRoleStore) Delete(item rbac.Role) error {
// Update updates an existing role. // Update updates an existing role.
func (s *MemoryRoleStore) Update(item rbac.Role) error { func (s *MemoryRoleStore) Update(item rbac.Role) error {
_, ok := s.Store[item.ID().String()] _, ok := s.Store[item.ID().String()]
if ok { if !ok {
return nil return errors.ErrCouldNotFind{StoreName: roleStoreName}
} }
var role rbac.LoadedRole var role rbac.LoadedRole
......
...@@ -55,8 +55,8 @@ func (s *MemoryUserStore) Delete(item rbac.User) error { ...@@ -55,8 +55,8 @@ func (s *MemoryUserStore) Delete(item rbac.User) error {
// Update updates an existing user. // Update updates an existing user.
func (s *MemoryUserStore) Update(item rbac.User) error { func (s *MemoryUserStore) Update(item rbac.User) error {
_, ok := s.Store[item.ID().String()] _, ok := s.Store[item.ID().String()]
if ok { if !ok {
return nil return errors.ErrCouldNotFind{StoreName: userStoreName}
} }
var user rbac.LoadedUser var user rbac.LoadedUser
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment