Update scope usage and add Changes for lightweight accounts

This commit is contained in:
Ishank Arora
2021-07-13 13:03:06 +02:00
parent 7b1130f34b
commit 29c5cb627a
6 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ func (m accountResolver) ServeHTTP(w http.ResponseWriter, req *http.Request) {
m.logger.Debug().Interface("claims", claims).Interface("user", u).Msgf("associated claims with uuid")
}
s, err := scope.GetOwnerScope()
s, err := scope.AddOwnerScope(nil)
if err != nil {
m.logger.Error().Err(err).Msgf("could not get owner scope")
return
+6 -3
View File
@@ -53,9 +53,12 @@ func (c *cs3backend) GetUserByClaims(ctx context.Context, claim, value string, w
return user, nil
}
roleIDs, err := loadRolesIDs(ctx, user.Id.OpaqueId, c.settingsRoleService)
if err != nil {
c.logger.Error().Err(err).Msg("Could not load roles")
var roleIDs []string
if user.Id.Type != cs3.UserType_USER_TYPE_LIGHTWEIGHT {
roleIDs, err = loadRolesIDs(ctx, user.Id.OpaqueId, c.settingsRoleService)
if err != nil {
c.logger.Error().Err(err).Msgf("Could not load roles")
}
}
if len(roleIDs) == 0 {