acl

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeAdmin

func AuthorizeAdmin(next http.Handler) http.Handler

AuthorizeAdmin returns an http.Handler middleware that authorizes only system administrators to proceed to the next handler in the chain.

func AuthorizeUser

func AuthorizeUser(next http.Handler) http.Handler

AuthorizeUser returns an http.Handler middleware that authorizes only authenticated users to proceed to the next handler in the chain. Guest users are rejected with a 401 unauthorized error.

func CheckAccess

func CheckAccess(read, write, admin bool) func(http.Handler) http.Handler

CheckAccess returns an http.Handler middleware that authorizes only authenticated users with the required read, write or admin access permissions to the requested repository resource.

func CheckAdminAccess

func CheckAdminAccess() func(http.Handler) http.Handler

CheckAdminAccess returns an http.Handler middleware that authorizes only authenticated users with admin repository access to proceed to the next handler in the chain.

func CheckMembership

func CheckMembership(service core.OrganizationService, admin bool) func(http.Handler) http.Handler

CheckMembership returns an http.Handler middleware that authorizes only authenticated users with the required membership to an organization to the requested repository resource.

func CheckReadAccess

func CheckReadAccess() func(http.Handler) http.Handler

CheckReadAccess returns an http.Handler middleware that authorizes only authenticated users with read repository access to proceed to the next handler in the chain.

func CheckWriteAccess

func CheckWriteAccess() func(http.Handler) http.Handler

CheckWriteAccess returns an http.Handler middleware that authorizes only authenticated users with write repository access to proceed to the next handler in the chain.

func InjectRepository

func InjectRepository(
	repoz core.RepositoryService,
	repos core.RepositoryStore,
	perms core.PermStore,
) func(http.Handler) http.Handler

InjectRepository returns an http.Handler middleware that injects the repository and repository permissions into the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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