permissions

package
v1.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrgRoleNone OrganizationRole = "NONE"

	OrgRoleOwner  = "OWNER"
	OrgRoleMember = "MEMBER"
)
View Source
const (
	GroupRoleNone Role = OrgRoleNone

	GroupRoleOwner  = OrgRoleOwner
	GroupRoleMember = OrgRoleMember
)
View Source
const (
	RepoRoleNone RepositoryRole = "NONE"

	RepoRoleAdmin      = "ADMIN"
	RepoRoleMaintainer = "MAINTAIN"
	RepoRoleWrite      = "WRITE"
	RepoRoleTriage     = "TRIAGE"
	RepoRoleRead       = "READ"
)
View Source
const (
	ScopeNone TokenScope = "None"

	RepoAdmin          = "repo"
	RepoRepoStatus     = "repo:status"
	RepoRepoDeployment = "repo_deployment"
	RepoPublicRepo     = "public_repo"
	RepoRepoInvite     = "repo:invite"
	RepoSecurityEvents = "security_events"
	RepoDelete         = "delete_repo"

	Workflow = "workflow"

	PackagesWrite  = "write:packages"
	PackagesRead   = "read:packages"
	PackagesDelete = "delete:packages"

	OrgAdmin = "admin:org"
	OrgWrite = "write:org"
	OrgRead  = "read:org"

	PublicKeyAdmin = "admin:public_key"
	PublicKeyWrite = "write:public_key"
	PublicKeyRead  = "read:public_key"

	OrgHookAdmin  = "admin:org_hook"
	RepoHookAdmin = "admin:repo_hook"
	RepoHookWrite = "write:repo_hook"
	RepoHookRead  = "read:repo_hook"

	Gist = "gist"

	Notifications = "notifications"

	UserAll    = "user"
	UserRead   = "read:user"
	UserEmail  = "read:email"
	UserFollow = "user:follow"

	DiscussionWrite = "write:discussion"
	DiscussionRead  = "read:discussion"

	EnterpriseAdmin         = "admin:enterprise"
	EnterpriseManageRunners = "manage_runners:enterprise"
	EnterpriseManageBilling = "manage_billing:enterprise"
	EnterpriseRead          = "read:enterprise"

	ProjectAll  = "project"
	ProjectRead = "read:project"

	GpgKeyAdmin = "admin:gpg_key"
	GpgKeyWrite = "write:gpg_key"
	GpgKeyRead  = "read:gpg_key"
)

Variables

This section is empty.

Functions

func HasEnterpriseScope added in v0.2.6

func HasEnterpriseScope(toCheck TokenScope, scopes TokenScopes, enterpriseRole EnterpriseRole) bool

func HasOrgScope

func HasOrgScope(toCheck TokenScope, scopes TokenScopes, orgRole OrganizationRole) bool

func HasRepoScope

func HasRepoScope(toCheck TokenScope, scopes TokenScopes, repoRole RepositoryRole) bool

func HasScope

func HasScope(requiredScope string, availableScopes TokenScopes, roles []Role) bool

func IsEnterpriseRole added in v0.2.6

func IsEnterpriseRole(role Role) bool

func IsOrgRole

func IsOrgRole(role Role) bool

func IsRepositoryRole

func IsRepositoryRole(role Role) bool

Types

type EnterpriseRole added in v0.2.6

type EnterpriseRole = string
const (
	EnterpriseAdminRole EnterpriseRole = "ENTERPRISE-ADMIN"

	EnterpriseNonAdminRole = "NON-ENTERPRISE-ADMIN"
)

type OrganizationRole

type OrganizationRole = string

func GetOrgRole

func GetOrgRole(canAdminister *bool) OrganizationRole

type RepositoryRole

type RepositoryRole = string

type Role

type Role = string

type TokenScope

type TokenScope = string

type TokenScopes

type TokenScopes = map[TokenScope]bool

func ParseTokenScopes

func ParseTokenScopes(scopesList []string) TokenScopes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL