security

package
v1.7.8-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	// IsAuthenticated returns whether the context has been authenticated or not
	IsAuthenticated() bool
	// GetUsername returns the username of user related to the context
	GetUsername() string
	// IsSysAdmin returns whether the user is system admin
	IsSysAdmin() bool
	// IsSolutionUser returns whether the user is solution user
	IsSolutionUser() bool
	// HasReadPerm returns whether the user has read permission to the project
	HasReadPerm(projectIDOrName interface{}) bool
	// HasWritePerm returns whether the user has write permission to the project
	HasWritePerm(projectIDOrName interface{}) bool
	// HasAllPerm returns whether the user has all permissions to the project
	HasAllPerm(projectIDOrName interface{}) bool
	// Get current user's all project
	GetMyProjects() ([]*models.Project, error)
	// Get user's role in provided project
	GetProjectRoles(projectIDOrName interface{}) []int
}

Context abstracts the operations related with authN and authZ

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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