rbac

package
v0.0.0-...-b84de06 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	ProjectsFunc func() (map[int64]string, error)
	// contains filtered or unexported fields
}

Server represents an RBAC server.

func NewServer

func NewServer(apiURL string, apiKey string, agentAuthURL string, agentUsername string, agentPrivateKey string, agentPublicKey string) (*Server, error)

NewServer returns a new RBAC server instance.

func (*Server) AddProject

func (r *Server) AddProject(id int64, name string) error

AddProject adds a new project resource to RBAC.

func (*Server) DeleteProject

func (r *Server) DeleteProject(id int64) error

DeleteProject adds a new project resource to RBAC.

func (*Server) HasPermission

func (r *Server) HasPermission(username, project, permission string) bool

HasPermission returns whether or not the user has the permission to perform a certain task.

func (*Server) IsAdmin

func (r *Server) IsAdmin(username string) bool

IsAdmin returns whether or not the provided user is an admin.

func (*Server) RenameProject

func (r *Server) RenameProject(id int64, name string) error

RenameProject renames an existing project resource in RBAC.

func (*Server) StartStatusCheck

func (r *Server) StartStatusCheck()

StartStatusCheck runs a status checking loop.

func (*Server) StopStatusCheck

func (r *Server) StopStatusCheck()

StopStatusCheck stops the periodic status checker.

func (*Server) SyncProjects

func (r *Server) SyncProjects() error

SyncProjects updates the list of projects in RBAC

Jump to

Keyboard shortcuts

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