Lesson 4 of 7 Authentication and Access

Designing Permissions and Roles in GitHub

This lesson explains organization roles, repository roles and teams.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe organization roles.
  • Explain how teams and base permissions work.
  • Choose a role for a stated need.
  • Design least-privilege access.

Levels of access

GitHub access has three levels. An enterprise account sets policies across organizations. An organization holds repositories and members. A repository grants specific access. A person's final access is the highest that they receive from any of those sources, including base permissions, team membership and direct grants.

Organization roles

Owner

Owners have full control of an organization, including billing, members and all repositories. Keep this group small, but keep at least two owners, so that an organization is not lost.

Member

Members belong to the organization. Their access depends on base permissions and team membership.

Billing manager

A billing manager handles payment settings, and has no access to private code. This suits a finance team.

Security manager

A security manager can manage security alerts and settings across the organization, and has read access to all repositories, which suits a central security team.

Moderator

A moderator can block users and manage interactions on public repositories.

Custom organization roles on Enterprise Cloud bundle specific administrative permissions, such as managing runners or viewing Actions metrics. This allows delegation with no need to make someone an owner.

Match the pairs

GitHub organization roles

Exam skills 4.1.4

Match each GitHub organization role with what it allows.

Log in to try this activity Interactive activities are free with an account.

Repository roles and teams

The five repository roles were introduced in the module on repository management: Read, Triage, Write, Maintain and Admin. The design question is who should hold them.

Teams are the right unit. A team reflects a real group, it receives a role on repositories, and joining the team grants all that access. Teams can be nested, so that a child team inherits the access of its parent, and teams can be synchronized with Microsoft Entra groups, so that joining or leaving is controlled in one place.

Base permissions set the minimum for all organization members on all repositories. A setting of None or Read means that access to write must be granted deliberately. Repository creation can also be restricted, and repository visibility rules can stop people making private code public. Inner source repositories, with internal visibility, are available to all members of an enterprise, which is useful for sharing.

The following diagram checks the repository roles against the three needs.

GitHub repository roles against the support staff's needs. Read cannot label or close others' issues; Triage manages issues and pull requests without write access; Write adds pushes and Maintain adds settings. Triage, granted to a support team, is the least role that fits.
Only the permissions in question are shown.
True or false

Teams and base permissions

Exam skills 4.1.4

Check how teams and base permissions shape GitHub access.

Log in to try this activity Interactive activities are free with an account.

A sample design

The following table shows how a typical organization might apply these ideas.

GroupAssignment
Platform leads (two or three people)Organization owners
Product teamsWrite on their own repositories, through a team
Team leadsMaintain on their own repositories
Support engineersTriage on product repositories
Security teamSecurity manager role
All membersBase permission of Read, or None
ContractorsOutside collaborators on specific repositories
Match the pairs

A least-privilege GitHub design

Exam skills 4.1.4 · 4.1.6

Match each group with the access a sample design gives it.

Log in to try this activity Interactive activities are free with an account.
Worked example

Granting issue management

Support staff must be able to label and close issues on a private repository, but must not push code or change settings. Which role should you grant, and how?

Grant the Triage role to a support team. Triage manages issues and pull requests with no write access. Write would allow pushes, Maintain would add settings, and Read cannot label or close an issue created by someone else.

Check yourself

Which organization role suits a finance employee who must not see private code?

Show answer

Billing manager, which allows payment settings and gives no access to private repositories.

Exam Tips

Remember for the exam

  • Keep organization owners few, but at least two.
  • Assign repository roles to teams, not individuals.
  • Security managers see security data across an organization.
  • Triage manages issues with no write access.
  • Set a low base permission, and grant access deliberately.