sonarcloud part II

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2022-03-04 16:04:40 +01:00
parent 6ff9df9f58
commit fc5a67c45e
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -46,12 +46,10 @@ func (s *Store) WriteRoleAssignment(accountUUID, roleID string) (*settingsmsg.Us
s.Init()
ctx := context.TODO()
// as per https://github.com/owncloud/product/issues/103 "Each user can have exactly one role"
err := s.mdc.Delete(ctx, accountPath(accountUUID))
if err != nil {
// TODO: How to differentiate between 'not found' and other errors?
}
_ = s.mdc.Delete(ctx, accountPath(accountUUID))
// TODO: How to differentiate between 'not found' and other errors?
err = s.mdc.MakeDirIfNotExist(ctx, accountPath(accountUUID))
err := s.mdc.MakeDirIfNotExist(ctx, accountPath(accountUUID))
if err != nil {
return nil, err
}
@@ -87,7 +87,7 @@ var (
)
func init() {
NewMDC(s)
_ = NewMDC(s)
setupRoles()
}