MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetUserFormattedRolesMap

Function GetUserFormattedRolesMap

backend/utils/member.go:297–305  ·  view source on GitHub ↗

See GetUserRoles. The returned map key format is roles/{role}.

(ctx context.Context, stores *store.Store, workspace string, user *store.UserMessage, projectPolicies ...*storepb.IamPolicy)

Source from the content-addressed store, hash-verified

295
296// See GetUserRoles. The returned map key format is roles/{role}.
297func GetUserFormattedRolesMap(ctx context.Context, stores *store.Store, workspace string, user *store.UserMessage, projectPolicies ...*storepb.IamPolicy) map[string]bool {
298 roles := GetUserRolesInIamPolicy(ctx, stores, workspace, user, projectPolicies...)
299
300 rolesMap := make(map[string]bool)
301 for _, role := range roles {
302 rolesMap[role] = true
303 }
304 return rolesMap
305}

Callers 3

getUserRoleMapMethod · 0.92
isUserWorkspaceAdminFunction · 0.92

Calls 1

GetUserRolesInIamPolicyFunction · 0.85

Tested by

no test coverage detected