Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support returning member roles in OrganizationManager.Members() #291

Closed
1 task done
renxinhe opened this issue Oct 17, 2023 · 0 comments
Closed
1 task done

Support returning member roles in OrganizationManager.Members() #291

renxinhe opened this issue Oct 17, 2023 · 0 comments
Labels

Comments

@renxinhe
Copy link
Contributor

renxinhe commented Oct 17, 2023

Checklist

Describe the problem you'd like to have solved

Auth0 API recently added support for member roles in the organizations/get-members endpoint. This enables us to fetch all the organization members' roles all at once without risking hitting the rate limit.

Currently, go-auth0 unfortunately doesn't return roles in OrganizationMember, and therefore there is no way to take advantage of this new RBAC feature.

// ===== github.com/auth0/go-auth0@v1.1.0/management/organization.go =====

// OrganizationMemberList is a list of OrganizationMembers.
type OrganizationMemberList struct {
	List
	Members []OrganizationMember `json:"members"`
}

// OrganizationMember holds member information for an Organization.
type OrganizationMember struct {
	UserID  *string `json:"user_id,omitempty"`
	Picture *string `json:"picture,omitempty"`
	Name    *string `json:"name,omitempty"`
	Email   *string `json:"email,omitempty"`
}

Describe the ideal solution

  • Add a new Roles []OrganizationMemberRole field to OrganizationMember
  • Optional: add a new boolean flag to Organization.Members() function to enable fetching of roles. Or simply ask users to use IncludeFields("roles")

Alternatives and current workarounds

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant