Skip to content

Commit 1616008

Browse files
authored
feat: Add assignment for org role associations (#3371)
Fixes: #3364.
1 parent d08d35e commit 1616008

File tree

5 files changed

+76
-6
lines changed

5 files changed

+76
-6
lines changed

github/github-accessors.go

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-stringify_test.go

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/teams.go

+9-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ type Team struct {
3030
// Permission specifies the default permission for repositories owned by the team.
3131
Permission *string `json:"permission,omitempty"`
3232

33-
// Permissions identifies the permissions that a team has on a given
34-
// repository. This is only populated when calling Repositories.ListTeams.
35-
Permissions map[string]bool `json:"permissions,omitempty"`
36-
3733
// Privacy identifies the level of privacy this team should have.
3834
// Possible values are:
3935
// secret - only visible to organization owners and members of this team
@@ -52,6 +48,15 @@ type Team struct {
5248
// LDAPDN is only available in GitHub Enterprise and when the team
5349
// membership is synchronized with LDAP.
5450
LDAPDN *string `json:"ldap_dn,omitempty"`
51+
52+
// Permissions identifies the permissions that a team has on a given
53+
// repository. This is only populated when calling Repositories.ListTeams.
54+
Permissions map[string]bool `json:"permissions,omitempty"`
55+
56+
// Assignment identifies how a team was assigned to an organization role. Its
57+
// possible values are: "direct", "indirect", "mixed". This is only populated when
58+
// calling the ListTeamsAssignedToOrgRole method.
59+
Assignment *string `json:"assignment,omitempty"`
5560
}
5661

5762
func (t Team) String() string {

github/users.go

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ type User struct {
7070
// repository. These are only populated when calling Repositories.ListCollaborators.
7171
Permissions map[string]bool `json:"permissions,omitempty"`
7272
RoleName *string `json:"role_name,omitempty"`
73+
74+
// Assignment identifies how a user was assigned to an organization role. Its
75+
// possible values are: "direct", "indirect", "mixed". This is only populated when
76+
// calling the ListUsersAssignedToOrgRole method.
77+
Assignment *string `json:"assignment,omitempty"`
78+
// InheritedFrom identifies the team that a user inherited their organization role
79+
// from. This is only populated when calling the ListUsersAssignedToOrgRole method.
80+
InheritedFrom *Team `json:"inherited_from,omitempty"`
7381
}
7482

7583
func (u User) String() string {

0 commit comments

Comments
 (0)