Repository: google/go-github (go)

Issue:
feat: Support assigning organization roles to teams and users
The GitHub API supports assigning (and removing) an Organization role to a user/team. These are the endpoints that should be supported (including both adding and removing an assignment):
* [`/orgs/ORG/organization-roles/teams/TEAM_SLUG/ROLE_ID`](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#assign-an-organization-role-to-a-team)
* [`/orgs/ORG/organization-roles/users/USERNAME/ROLE_ID`](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/organization-roles?apiVersion=2022-11-28#assign-an-organization-role-to-a-team)

I can work on this as well

Pull request description:
feat: Implement organization role assignments for both users and teams
resolves #3280 

Patch:
diff --git a/AUTHORS b/AUTHORS
index 075ba8df..d2116450 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,7 +13,10 @@
 413x <dedifferentiator@gmail.com>
 6543 <6543@obermui.de>
 Abed Kibbe <abed.kibbe@gmail.com>
+Abhijit Hota <abhihota025@gmail.com>
 Abhinav Gupta <mail@abhinavg.net>
+abhishek <abhishek@exaforce.com>
+Abhishek Sharma <abhishekbiyala@gmail.com>
 Abhishek Veeramalla <abhishek.veeramalla@gmail.com>
 aboy <b1011211@gmail.com>
 Adam Kohring <ajkohring@gmail.com>
@@ -35,19 +38,24 @@ Alex Orr <Alexorr.CSE@gmail.com>
 Alex Su <alexsu@17.media>
 Alex Unger <zyxancf@gmail.com>
 Alexander Harkness <me@bearbin.net>
+Alexey Alekhin <laughedelic@gmail.com>
 Alexis Gauthiez <alexis.gauthiez@gmail.com>
 Ali Farooq <ali.farooq0@pm.me>
+Alin Balutoiu <alinbalutoiu@gmail.com>
 Allan Guwatudde <guwats10@gmail.com>
 Allen Sun <shlallen1990@gmail.com>
 Amey Sakhadeo <me@ameyms.com>
 Anders Janmyr <anders@janmyr.com>
+Andreas Deininger <andreas@deininger.net>
 Andreas Garnæs <https://github.com/andreas>
 Andrew Ryabchun <aryabchun@mail.ua>
 Andrew Svoboda <svoboda.andrew@gmail.com>
+Andriyun <andriy.yun@gmail.com>
 Andy Grunwald <andygrunwald@gmail.com>
 Andy Hume <andyhume@gmail.com>
 Andy Lindeman <andy@lindeman.io>
 angie pinilla <angelinepinilla@gmail.com>
+Anish Rajan <anishrajan2708@gmail.com>
 anjanashenoy <anjanashenoy1@gmail.com>
 Anshuman Bhartiya <anshuman.bhartiya@gmail.com>
 Antoine <antoine.tu@mail.mcgill.ca>
@@ -59,6 +67,7 @@ aprp <doelaudi@gmail.com>
 apurwaj2 <apurwaj2@gmail.com>
 Aravind <aravindkp@outlook.in>
 Arda Kuyumcu <kuyumcuarda@gmail.com>
+Ary <arylmoraesn@hotmail.com>
 Arıl Bozoluk <arilbozoluk@hotmail.com>
 Asier Marruedo <asiermarruedo@gmail.com>
 Austin Burdine <acburdine@gmail.com>
@@ -66,9 +75,11 @@ Austin Dizzy <dizzy@wow.com>
 Azuka Okuleye <azuka@zatechcorp.com>
 Ben Batha <bhbatha@gmail.com>
 Benjamen Keroack <benjamen@dollarshaveclub.com>
+Benjamin Nater <benjamin@nater.net>
 Berkay Tacyildiz <berkaytacyildiz@gmail.com>
 Beshr Kayali <beshrkayali@gmail.com>
 Beyang Liu <beyang.liu@gmail.com>
+billnapier <napier@pobox.com>
 Billy Keyes <bluekeyes@gmail.com>
 Billy Lynch <wlynch92@gmail.com>
 Bingtan Lu <lubingtan@126.com>
@@ -93,6 +104,7 @@ Cami Diez <diezcami@gmail.com>
 Carl Johnson <me@carlmjohnson.net>
 Carlos Alexandro Becker <caarlos0@gmail.com>
 Carlos Tadeu Panato Junior <ctadeu@gmail.com>
+Casey <casey.duquette@snapchat.com>
 ChandanChainani <chainanichan@gmail.com>
 chandresh-pancholi <chandreshpancholi007@gmail.com>
 Charles Fenwick Elliott <Charles@FenwickElliott.io>
@@ -109,6 +121,7 @@ Christian Muehlhaeuser <muesli@gmail.com>
 Christoph Jerolimov <jerolimov@gmail.com>
 Christoph Sassenberg <defsprite@gmail.com>
 CI Monk <ci-monk@protonmail.com>
+Clemens W <Clemens.wijnekus@nordnet.se>
 Colin Misare <github.com/cmisare>
 Craig Gumbley <craiggumbley@gmail.com>
 Craig Peterson <cpeterson@stackoverflow.com>
@@ -137,6 +150,7 @@ DeviousLab <deviouslab@gmail.com>
 Dhi Aurrahman <diorahman@rockybars.com>
 Diego Lapiduz <diego.lapiduz@cfpb.gov>
 Diogo Vilela <be0x74a@gmail.com>
+Dion Gionet Mallet <dionmallet@hotmail.com>
 Dmitri Shuralyov <shurcooL@gmail.com>
 dmnlk <seikima2demon@gmail.com>
 Don Petersen <don@donpetersen.net>
@@ -149,9 +163,12 @@ Eli Uriegas <seemethere101@gmail.com>
 Elliott Beach <elliott2.71828@gmail.com>
 Emerson Wood <emersonwood94@gmail.com>
 Emil V <emil.vaagland@schibsted.com>
+Emma Sax <esselbach_briley@simplelogin.com>
 Eng Zer Jun <engzerjun@gmail.com>
+Enrico Candino <enrico.candino@gmail.com>
 eperm <staffordworrell@gmail.com>
 Erick Fejta <erick@fejta.com>
+Erik Elkins <erik.elkins@outlook.com>
 Erik Nobel <hendrik.nobel@transferwise.com>
 erwinvaneyk <erwinvaneyk@gmail.com>
 Evan Anderson <evan.k.anderson@gmail.com>
@@ -163,6 +180,7 @@ Federico Di Pierro <nierro92@gmail.com>
 Felix Geisendörfer <felix@debuggable.com>
 Filippo Valsorda <hi@filippo.io>
 Florian Forster <ff@octo.it>
+Florian Maier <florianmaier101178@gmail.com>
 Florian Wagner <h2floh@github.com>
 Francesc Gil <xescugil@gmail.com>
 Francis <hello@francismakes.com>
@@ -178,6 +196,7 @@ Glen Mailer <glenjamin@gmail.com>
 Gnahz <p@oath.pl>
 Google Inc.
 Grachev Mikhail <work@mgrachev.com>
+Gregory Oschwald <oschwald@gmail.com>
 griffin_stewie <panterathefamilyguy@gmail.com>
 guangwu <guoguangwu@magic-shield.com>
 Guillaume Jacquet <guillaume.jacquet@gmail.com>
@@ -202,6 +221,7 @@ ishan upadhyay <ishanupadhyay412@gmail.com>
 isqua <isqua@isqua.ru>
 Jacob Valdemar <jan@lunar.app>
 Jake Krammer <jake.krammer1@gmail.com>
+Jake Scaltreto <jake.scaltreto@circle.com>
 Jake White <jake@jwhite.network>
 Jameel Haffejee <RC1140@republiccommandos.co.za>
 James Bowes <jbowes@repl.ca>
@@ -210,6 +230,7 @@ James Loh <github@jloh.co>
 James Maguire <jvm986@gmail.com>
 James Turley <jamesturley1905@googlemail.com>
 Jamie West <jamieianwest@hotmail.com>
+Jan Guth <Jan.Guth@gmail.com>
 Jan Kosecki <jan.kosecki91@gmail.com>
 Jan Švábík <jansvabik@jansvabik.cz>
 Jason Field <Jason@avon-lea.co.uk>
@@ -224,6 +245,7 @@ Jihoon Chung <j.c@navercorp.com>
 Jille Timmermans <jille@quis.cx>
 Jimmi Dyson <jimmidyson@gmail.com>
 Joan Saum <joan.saum@epitech.eu>
+JoannaaKL <joannaakl@github.com>
 Joe Tsai <joetsai@digital-static.net>
 John Barton <jrbarton@gmail.com>
 John Engelman <john.r.engelman@gmail.com>
@@ -232,6 +254,7 @@ John Liu <john.liu@mongodb.com>
 Jordan Brockopp <jdbro94@gmail.com>
 Jordan Burandt <jordanburandt@gmail.com>
 Jordan Sussman <jordansail22@gmail.com>
+Jorge Ferrero <jorgeferrerolinacero@gmail.com>
 Jorge Gómez Reus <j-g1996@live.com>
 Joshua Bezaleel Abednego <joshua.bezaleel@gmail.com>
 João Cerqueira <joao@cerqueira.io>
@@ -240,6 +263,7 @@ jpbelanger-mtl <jp.belanger@gmail.com>
 Juan <juan.rios.28@gmail.com>
 Juan Basso <jrbasso@gmail.com>
 Julien Garcia Gonzalez <garciagonzalez.julien@gmail.com>
+Julien Midedji <Julien.Midedji@gmail.com>
 Julien Rostand <jrostand@users.noreply.github.com>
 Junya Kono <junya03dance@gmail.com>
 Justin Abrahms <justin@abrah.ms>
@@ -257,6 +281,7 @@ Kevin Burke <kev@inburke.com>
 Kevin Wang <kwangsan@gmail.com>
 Kevin Zhao <kzhao@lyft.com>
 kgalli <mail@kgalli.de>
+Khanh Ngo <k@ndk.name>
 Kirill <g4s8.public@gmail.com>
 Konrad Malawski <konrad.malawski@project13.pl>
 Kookheon Kwon <kucuny@gmail.com>
@@ -266,10 +291,12 @@ Kshitij Saraogi <KshitijSaraogi@gmail.com>
 Kumar Saurabh <itsksaurabh@gmail.com>
 Kyle Kurz <kyle@doublekaudio.com>
 kyokomi <kyoko1220adword@gmail.com>
+Lachlan Cooper <lachlancooper@gmail.com>
 Lars Lehtonen <lars.lehtonen@gmail.com>
 Laurent Verdoïa <verdoialaurent@gmail.com>
 leopoldwang <leopold.wang@gmail.com>
 Liam Galvin <liam@liam-galvin.co.uk>
+Liam Stanley <liam@liam.sh>
 Lluis Campos <lluis.campos@northern.tech>
 Lovro Mažgon <lovro.mazgon@gmail.com>
 Loïs Postula <lois@postu.la>
@@ -283,6 +310,8 @@ Luke Kysow <lkysow@gmail.com>
 Luke Roberts <email@luke-roberts.co.uk>
 Luke Young <luke@hydrantlabs.org>
 lynn [they] <lynncyrin@gmail.com>
+Léo Salé <leo.sale@datadoghq.com>
+M. Ryan Rigdon <mr.rigdon@gmail.com>
 Magnus Kulke <mkulke@gmail.com>
 Maksim Zhylinski <uzzable@gmail.com>
 Marc Binder <marcandrebinder@gmail.com>
@@ -294,6 +323,7 @@ Martins Sipenko <martins.sipenko@gmail.com>
 Marwan Sulaiman <marwan.sameer@gmail.com>
 Masayuki Izumi <m@izum.in>
 Mat Geist <matgeist@gmail.com>
+Matheus Santos Araújo <wenked.matheus@yahoo.com.br>
 Matija Horvat <horvat2112@gmail.com>
 Matin Rahmanian <itsmatinx@gmail.com>
 Matt <alpmatthew@gmail.com>
@@ -301,6 +331,7 @@ Matt Brender <mjbrender@gmail.com>
 Matt Dainty <matt@bodgit-n-scarper.com>
 Matt Gaunt <matt@gauntface.co.uk>
 Matt Landis <landis.matt@gmail.com>
+Matt Mencel <matt@techminer.net>
 Matt Moore <mattmoor@vmware.com>
 Matt Simons <mattsimons@ntlworld.com>
 Matthew Reidy <matthewreidy5@gmail.com>
@@ -312,8 +343,11 @@ Michał Glapa <michal.glapa@gmail.com>
 Michelangelo Morrillo <michelangelo@morrillo.it>
 Miguel Elias dos Santos <migueleliasweb@gmail.com>
 Mike Chen <mchen300@gmail.com>
+Mishin Nikolai <sanduku.default@gmail.com>
 mohammad ali <2018cs92@student.uet.edu.pk>
 Mohammed AlDujaili <avainer11@gmail.com>
+Mohammed Nafees <hello@mnafees.me>
+Mudit <zeusdeux@gmail.com>
 Mukundan Senthil <mukundan314@gmail.com>
 Munia Balayil <munia.247@gmail.com>
 Mustafa Abban <mustafaabban@utexas.edu>
@@ -321,16 +355,20 @@ Nadav Kaner <nadavkaner1@gmail.com>
 Naoki Kanatani <k12naoki@gmail.com>
 Nathan VanBenschoten <nvanbenschoten@gmail.com>
 Navaneeth Suresh <navaneeths1998@gmail.com>
+Nayeem Hasan <nayeemhasan.nh01@gmail.com>
 Neal Caffery <neal1991@sina.com>
 Neil O'Toole <neilotoole@apache.org>
+Nicholas Herring <oss@hakshak.com>
 Nick Miyake <nmiyake@palantir.com>
 Nick Platt <hello@nickplatt.co.uk>
 Nick Spragg <nick.spragg@bbc.co.uk>
 Nicolas Chapurlat <nc@coorganix.com>
 Nikhita Raghunath <nikitaraghunath@gmail.com>
+Nikita Pivkin <nikita.pivkin@smartforce.io>
 Nilesh Singh <nilesh.singh24@outlook.com>
 Noah Hanjun Lee <noah.lee@buzzvil.com>
 Noah Zoschke <noah+sso2@convox.com>
+Noble Varghese <noblekvarghese96@gmail.com>
 ns-cweber <cweber@narrativescience.com>
 nxya <nathacutlan@gmail.com>
 Ole Orhagen <ole.orhagen@northern.tech>
@@ -358,6 +396,7 @@ Pierce McEntagart <pierce@nightfall.ai>
 Pierre Carrier <pierre@meteor.com>
 Piotr Zurek <p.zurek@gmail.com>
 Piyush Chugh <piyushchugh1993@gmail.com>
+Pj Meyer <peej.meyer@gmail.com>
 Pratik Mallya <pratik.mallya@gmail.com>
 Qais Patankar <qaisjp@gmail.com>
 Quang Le Hong <iamquang95@gmail.com>
@@ -370,6 +409,7 @@ Rafael Aramizu Gomes <rafael.aramizu@mercadolivre.com>
 Rajat Jindal <rajatjindal83@gmail.com>
 Rajendra arora <rajendraarora16@yahoo.com>
 Rajkumar <princegosavi12@gmail.com>
+Ramesh Gaikwad <rameshgkwd05@gmail.com>
 Ranbir Singh <binkkatal.r@gmail.com>
 Ravi Shekhar Jethani <rsjethani@gmail.com>
 RaviTeja Pothana <ravi-teja@live.com>
@@ -379,18 +419,23 @@ Reetuparna Mukherjee <reetuparna.1988@gmail.com>
 reeves122 <reeves122@gmail.com>
 Reinier Timmer <reinier.timmer@ah.nl>
 Renjith R <renjithr201097@gmail.com>
+Rez Moss <hi@rezmoss.com>
+Riaje <francois@mbfr.fr>
 Ricco Førgaard <ricco@fiskeben.dk>
 Richard de Vries <richard.de.vries@topicus.nl>
 Rob Figueiredo <robfig@yext.com>
 Rohit Upadhyay <urohit011@gmail.com>
 Rojan Dinc <rojand94@gmail.com>
+Roming22 <roming22@gmail.com>
 Ronak Jain <ronakjain@outlook.in>
 Ronan Pelliard <ronan.pelliard@datadoghq.com>
 Ross Gustafson <srgustafson8@icloud.com>
 Ruben Vereecken <rubenvereecken@gmail.com>
+Rufina Talalaeva <rufusnorbert14@gmail.com>
 Russell Boley <raboley@gmail.com>
 Ryan Leung <rleungx@gmail.com>
 Ryan Lower <rpjlower@gmail.com>
+Ryan Skidmore <github@ryanskidmore.co.uk>
 Ryo Nakao <nakabonne@gmail.com>
 Saaarah <sarah.liusy@gmail.com>
 Safwan Olaimat <safwan.olaimat@gmail.com>
@@ -452,6 +497,9 @@ Tingluo Huang <tingluohuang@github.com>
 tkhandel <tarunkhandelwal.iitr@gmail.com>
 Tobias Gesellchen <tobias@gesellix.de>
 Tom Payne <twpayne@gmail.com>
+Tomasz Adam Skrzypczak <tomasz.adam.skrzypczak@protonmail.com>
+tomfeigin <tom.feigin@gmail.com>
+Travis Tomsu <travis.tomsu@gmail.com>
 Trey Tacon <ttacon@gmail.com>
 tsbkw <tsbkw0@gmail.com>
 ttacon <ttacon@gmail.com>
@@ -483,7 +531,8 @@ Yurii Soldak <ysoldak@gmail.com>
 Yusef Mohamadi <yuseferi@gmail.com>
 Yusuke Kuoka <ykuoka@gmail.com>
 Zach Latta <zach@zachlatta.com>
+Ze Peng <zehui.peng@circle.com>
 zhouhaibing089 <zhouhaibing089@gmail.com>
 六开箱 <lkxed@outlook.com>
 缘生 <i@ysicing.me>
-蒋航 <hang.jiang@daocloud.io>
\ No newline at end of file
+蒋航 <hang.jiang@daocloud.io>
diff --git a/github/github-accessors.go b/github/github-accessors.go
index a99a06aa..a025f781 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -4414,6 +4414,14 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string {
 	return *c.Name
 }
 
+// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise.
+func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string {
+	if c == nil || c.BaseRole == nil {
+		return ""
+	}
+	return *c.BaseRole
+}
+
 // GetDescription returns the Description field if it's non-nil, zero value otherwise.
 func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string {
 	if c == nil || c.Description == nil {
diff --git a/github/orgs_custom_roles.go b/github/orgs_custom_roles.go
index ca0c6d7b..f48fc697 100644
--- a/github/orgs_custom_roles.go
+++ b/github/orgs_custom_roles.go
@@ -54,6 +54,7 @@ type CreateOrUpdateOrgRoleOptions struct {
 	Name        *string  `json:"name,omitempty"`
 	Description *string  `json:"description,omitempty"`
 	Permissions []string `json:"permissions"`
+	BaseRole    *string  `json:"base_role,omitempty"`
 }
 
 // CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role.
@@ -87,6 +88,29 @@ func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*Orga
 	return customRepoRoles, resp, nil
 }
 
+// GetOrgRole gets an organization role in this organization.
+// In order to get organization roles in an organization, the authenticated user must be an organization owner, or have access via an organization role.
+//
+// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role
+//
+//meta:operation GET /orgs/{org}/organization-roles/{role_id}
+func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleID int64) (*CustomOrgRoles, *Response, error) {
+	u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID)
+
+	req, err := s.client.NewRequest("GET", u, nil)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	resultingRole := new(CustomOrgRoles)
+	resp, err := s.client.Do(ctx, req, resultingRole)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return resultingRole, resp, err
+}
+
 // CreateCustomOrgRole creates a custom role in this organization.
 // In order to create custom roles in an organization, the authenticated user must be an organization owner.
 //
@@ -156,6 +180,94 @@ func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org stri
 	return resp, nil
 }
 
+// AssignOrgRoleToTeam assigns an existing organization role to a team in this organization.
+// In order to assign organization roles in an organization, the authenticated user must be an organization owner.
+//
+// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team
+//
+//meta:operation PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}
+func (s *OrganizationsService) AssignOrgRoleToTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) {
+	u := fmt.Sprintf("orgs/%v/organization-roles/teams/%v/%v", org, teamSlug, roleID)
+
+	req, err := s.client.NewRequest("PUT", u, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	resp, err := s.client.Do(ctx, req, nil)
+	if err != nil {
+		return resp, err
+	}
+
+	return resp, nil
+}
+
+// RemoveOrgRoleFromTeam removes an existing organization role assignment from a team in this organization.
+// In order to remove organization role assignments in an organization, the authenticated user must be an organization owner.
+//
+// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team
+//
+//meta:operation DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}
+func (s *OrganizationsService) RemoveOrgRoleFromTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) {
+	u := fmt.Sprintf("orgs/%v/organization-roles/teams/%v/%v", org, teamSlug, roleID)
+
+	req, err := s.client.NewRequest("DELETE", u, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	resp, err := s.client.Do(ctx, req, nil)
+	if err != nil {
+		return resp, err
+	}
+
+	return resp, nil
+}
+
+// AssignOrgRoleToUser assigns an existing organization role to a user in this organization.
+// In order to assign organization roles in an organization, the authenticated user must be an organization owner.
+//
+// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user
+//
+//meta:operation PUT /orgs/{org}/organization-roles/users/{username}/{role_id}
+func (s *OrganizationsService) AssignOrgRoleToUser(ctx context.Context, org, username string, roleID int64) (*Response, error) {
+	u := fmt.Sprintf("orgs/%v/organization-roles/users/%v/%v", org, username, roleID)
+
+	req, err := s.client.NewRequest("PUT", u, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	resp, err := s.client.Do(ctx, req, nil)
+	if err != nil {
+		return resp, err
+	}
+
+	return resp, nil
+}
+
+// RemoveOrgRoleFromUser removes an existing organization role assignment from a user in this organization.
+// In order to remove organization role assignments in an organization, the authenticated user must be an organization owner.
+//
+// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user
+//
+//meta:operation DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}
+func (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, username string, roleID int64) (*Response, error) {
+	u := fmt.Sprintf("orgs/%v/organization-roles/users/%v/%v", org, username, roleID)
+
+	req, err := s.client.NewRequest("DELETE", u, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	resp, err := s.client.Do(ctx, req, nil)
+	if err != nil {
+		return resp, err
+	}
+
+	return resp, nil
+}
+
 // ListCustomRepoRoles lists the custom repository roles available in this organization.
 // In order to see custom repository roles in an organization, the authenticated user must be an organization owner.
 //


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index 2db51bab..ae380160 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -5179,6 +5179,16 @@ func TestCreateOrUpdateCustomRepoRoleOptions_GetName(tt *testing.T) {
 	c.GetName()
 }
 
+func TestCreateOrUpdateOrgRoleOptions_GetBaseRole(tt *testing.T) {
+	var zeroValue string
+	c := &CreateOrUpdateOrgRoleOptions{BaseRole: &zeroValue}
+	c.GetBaseRole()
+	c = &CreateOrUpdateOrgRoleOptions{}
+	c.GetBaseRole()
+	c = nil
+	c.GetBaseRole()
+}
+
 func TestCreateOrUpdateOrgRoleOptions_GetDescription(tt *testing.T) {
 	var zeroValue string
 	c := &CreateOrUpdateOrgRoleOptions{Description: &zeroValue}
diff --git a/github/orgs_custom_roles_test.go b/github/orgs_custom_roles_test.go
index 338eac19..dad11594 100644
--- a/github/orgs_custom_roles_test.go
+++ b/github/orgs_custom_roles_test.go
@@ -98,6 +98,105 @@ func TestOrganizationsService_ListRoles(t *testing.T) {
 	})
 }
 
+func TestOrganizationsService_GetOrgRole(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	// Test built-in org role
+	mux.HandleFunc("/orgs/o/organization-roles/8132", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "GET")
+		fmt.Fprint(w, `{
+			"id": 8132,
+			"name": "all_repo_read",
+			"description": "Grants read access to all repositories in the organization.",
+			"permissions": [],
+			"created_at": `+referenceTimeStr+`,
+			"updated_at": `+referenceTimeStr+`,
+			"source": "Predefined",
+			"base_role": "read"
+		}`)
+	})
+
+	ctx := context.Background()
+
+	gotBuiltInRole, _, err := client.Organizations.GetOrgRole(ctx, "o", 8132)
+	if err != nil {
+		t.Errorf("Organizations.GetOrgRole returned error: %v", err)
+	}
+
+	wantBuiltInRole := &CustomOrgRoles{
+		ID:          Int64(8132),
+		Name:        String("all_repo_read"),
+		Description: String("Grants read access to all repositories in the organization."),
+		Permissions: []string{},
+		CreatedAt:   &Timestamp{referenceTime},
+		UpdatedAt:   &Timestamp{referenceTime},
+		Source:      String("Predefined"),
+		BaseRole:    String("read"),
+	}
+
+	if !cmp.Equal(gotBuiltInRole, wantBuiltInRole) {
+		t.Errorf("Organizations.GetOrgRole returned %+v, want %+v", gotBuiltInRole, wantBuiltInRole)
+	}
+
+	// Test custom org role
+	mux.HandleFunc("/orgs/o/organization-roles/123456", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "GET")
+		fmt.Fprint(w, `{
+			"id": 123456,
+			"name": "test-role",
+			"description": "test-role",
+			"permissions": [
+				"read_organization_custom_org_role",
+				"read_organization_custom_repo_role",
+				"write_organization_custom_org_role"
+			],
+			"created_at": `+referenceTimeStr+`,
+			"updated_at": `+referenceTimeStr+`,
+			"source": "Organization",
+			"base_role": null
+			}`)
+	})
+
+	gotCustomRole, _, err := client.Organizations.GetOrgRole(ctx, "o", 123456)
+	if err != nil {
+		t.Errorf("Organizations.GetOrgRole returned error: %v", err)
+	}
+
+	wantCustomRole := &CustomOrgRoles{
+		ID:          Int64(123456),
+		Name:        String("test-role"),
+		Description: String("test-role"),
+		Permissions: []string{
+			"read_organization_custom_org_role",
+			"read_organization_custom_repo_role",
+			"write_organization_custom_org_role",
+		},
+		CreatedAt: &Timestamp{referenceTime},
+		UpdatedAt: &Timestamp{referenceTime},
+		Source:    String("Organization"),
+		BaseRole:  nil,
+	}
+
+	if !cmp.Equal(gotCustomRole, wantCustomRole) {
+		t.Errorf("Organizations.GetOrgRole returned %+v, want %+v", gotCustomRole, wantCustomRole)
+	}
+
+	const methodName = "GetOrgRole"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Organizations.GetOrgRole(ctx, "\no", -8132)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Organizations.GetOrgRole(ctx, "o", 8132)
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
+
 func TestOrganizationsService_CreateCustomOrgRole(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
@@ -212,6 +311,122 @@ func TestOrganizationsService_DeleteCustomOrgRole(t *testing.T) {
 	})
 }
 
+func TestOrganizationsService_AssignOrgRoleToTeam(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/orgs/o/organization-roles/teams/t/8030", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "PUT")
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	ctx := context.Background()
+	resp, err := client.Organizations.AssignOrgRoleToTeam(ctx, "o", "t", 8030)
+	if err != nil {
+		t.Errorf("Organization.AssignOrgRoleToTeam return error: %v", err)
+	}
+	if !cmp.Equal(resp.StatusCode, http.StatusNoContent) {
+		t.Errorf("Organizations.AssignOrgRoleToTeam returned status code %+v, want %+v", resp.StatusCode, http.StatusNoContent)
+	}
+
+	const methodName = "AssignOrgRoleToTeam"
+	testBadOptions(t, methodName, func() (err error) {
+		_, err = client.Organizations.AssignOrgRoleToTeam(ctx, "\no", "\nt", -8030)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		return client.Organizations.AssignOrgRoleToTeam(ctx, "o", "t", 8030)
+	})
+}
+
+func TestOrganizationsService_RemoveOrgRoleFromTeam(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/orgs/o/organization-roles/teams/t/8030", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "DELETE")
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	ctx := context.Background()
+	resp, err := client.Organizations.RemoveOrgRoleFromTeam(ctx, "o", "t", 8030)
+	if err != nil {
+		t.Errorf("Organization.RemoveOrgRoleFromTeam return error: %v", err)
+	}
+	if !cmp.Equal(resp.StatusCode, http.StatusNoContent) {
+		t.Errorf("Organizations.RemoveOrgRoleFromTeam returned status code %+v, want %+v", resp.StatusCode, http.StatusNoContent)
+	}
+
+	const methodName = "RemoveOrgRoleFromTeam"
+	testBadOptions(t, methodName, func() (err error) {
+		_, err = client.Organizations.RemoveOrgRoleFromTeam(ctx, "\no", "\nt", -8030)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		return client.Organizations.RemoveOrgRoleFromTeam(ctx, "o", "t", 8030)
+	})
+}
+
+func TestOrganizationsService_AssignOrgRoleToUser(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/orgs/o/organization-roles/users/t/8030", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "PUT")
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	ctx := context.Background()
+	resp, err := client.Organizations.AssignOrgRoleToUser(ctx, "o", "t", 8030)
+	if err != nil {
+		t.Errorf("Organization.AssignOrgRoleToUser return error: %v", err)
+	}
+	if !cmp.Equal(resp.StatusCode, http.StatusNoContent) {
+		t.Errorf("Organizations.AssignOrgRoleToUser returned status code %+v, want %+v", resp.StatusCode, http.StatusNoContent)
+	}
+
+	const methodName = "AssignOrgRoleToUser"
+	testBadOptions(t, methodName, func() (err error) {
+		_, err = client.Organizations.AssignOrgRoleToUser(ctx, "\no", "\nt", -8030)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		return client.Organizations.AssignOrgRoleToUser(ctx, "o", "t", 8030)
+	})
+}
+
+func TestOrganizationsService_RemoveOrgRoleFromUser(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/orgs/o/organization-roles/users/t/8030", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "DELETE")
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	ctx := context.Background()
+	resp, err := client.Organizations.RemoveOrgRoleFromUser(ctx, "o", "t", 8030)
+	if err != nil {
+		t.Errorf("Organization.RemoveOrgRoleFromUser return error: %v", err)
+	}
+	if !cmp.Equal(resp.StatusCode, http.StatusNoContent) {
+		t.Errorf("Organizations.RemoveOrgRoleFromUser returned status code %+v, want %+v", resp.StatusCode, http.StatusNoContent)
+	}
+
+	const methodName = "RemoveOrgRoleFromUser"
+	testBadOptions(t, methodName, func() (err error) {
+		_, err = client.Organizations.RemoveOrgRoleFromUser(ctx, "\no", "\nt", -8030)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		return client.Organizations.RemoveOrgRoleFromUser(ctx, "o", "t", 8030)
+	})
+}
+
 func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()