Get-GitHubRepositoryCollaboratorPermissionLevel
SYNOPSIS
Get repository permissions for a user
SYNTAX
__AllParameterSets
Get-GitHubRepositoryCollaboratorPermissionLevel [-Owner] <string> [-Repo] <string>
[-Username] <string> [-Accept <string>]
ALIASES
This cmdlet has the following aliases,
- Get-GHRepositoryCollaboratorPermissionLevel
DESCRIPTION
The Get-GitHubRepositoryCollaboratorPermissionLevel cmdlet invokes the GET method of the /repos/{owner}/{repo}/collaborators/{username}/permission endpoint (Get repository permissions for a user)
Checks the repository permission and role of a collaborator.
The ‘permission’ attribute provides the legacy base roles of ‘admin’, ‘write’, ‘read’, and ‘none’, where the ‘maintain’ role is mapped to ‘write’ and the ‘triage’ role is mapped to ‘read’. The ‘role_name’ attribute provides the name of the assigned role, including custom roles. The ‘permission’ can also be used to determine which base level of access the collaborator has to the repository.
The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response.
Endpoint: GET /repos/{owner}/{repo}/collaborators/{username}/permission API version: 2026-03-10
EXAMPLES
EXAMPLE 1
Get-GitHubRepositoryCollaboratorPermissionLevel -Owner 'octocat' -Repo 'Hello-World' -Username 'octocat'
Invokes GET /repos/{owner}/{repo}/collaborators/{username}/permission
PARAMETERS
-Accept
The Accept header (media type) of the request Default value: application/vnd.github+json
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Owner
The account owner of the repository. The name is not case sensitive.
Path parameter [ owner ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Repo
The name of the repository without the ‘.git’ extension. The name is not case sensitive.
Path parameter [ repo ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Username
The handle for the GitHub user account.
Path parameter [ username ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
Objects with properties named like the path parameters can be piped to this function
{{ Fill in the Description }}
System.String
{{ Fill in the Description }}
OUTPUTS
The response of the GitHub API (objects
{{ Fill in the Description }}
NOTES
OperationId: repos/get-collaborator-permission-level Category: collaborators / collaborators