MCPcopy Create free account
hub / github.com/auth0/auth0-cli / userRolesToRemovePickerOptions

Function userRolesToRemovePickerOptions

internal/cli/users_roles.go:321–333  ·  view source on GitHub ↗
(ctx context.Context, cli *cli, userID string)

Source from the content-addressed store, hash-verified

319}
320
321func userRolesToRemovePickerOptions(ctx context.Context, cli *cli, userID string) ([]string, error) {
322 currentUserRoleList, err := cli.api.User.Roles(ctx, userID, management.PerPage(100))
323 if err != nil {
324 return nil, fmt.Errorf("failed to read the current roles for user with ID %q: %w", userID, err)
325 }
326
327 var options []string
328 for _, role := range currentUserRoleList.Roles {
329 options = append(options, fmt.Sprintf("%s (Name: %s)", role.GetID(), role.GetName()))
330 }
331
332 return options, nil
333}
334
335func containsRole(roles []*management.Role, roleID string) bool {
336 for _, role := range roles {

Callers 1

Calls 3

ErrorfMethod · 0.80
RolesMethod · 0.65
GetNameMethod · 0.65

Tested by 1