You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor Grant method in orgRole to enhance error handling and role verification. Replaced role existence check with a direct API request, improved entitlement ID validation, and streamlined request creation for assigning roles to users.
// Needs review, I copied this from the team grant function, but roles can be granted to teams as well, but we don't necessarily support that so wasn't sure if this was the intended behavior.
returnnil, fmt.Errorf("failed to get user: %w", err)
323
321
}
324
322
325
-
l.Info("attempting to assign role",
326
-
zap.String("org", orgName),
327
-
zap.Int64("role_id", roleID),
328
-
zap.String("user", user.GetLogin()),
329
-
)
330
-
331
-
// Use the client's HTTP client to make the request with the correct URL format. Couldn't find a built in function for this. Cursor suggested this approach.
0 commit comments