lxd: github.com/lxc/lxd/lxd/rbac Index | Files

package rbac

import "github.com/lxc/lxd/lxd/rbac"

Index

Package Files

server.go

type Server Uses

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

Server represents an RBAC server.

func NewServer Uses

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 Uses

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

AddProject adds a new project resource to RBAC.

func (*Server) DeleteProject Uses

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

DeleteProject adds a new project resource to RBAC.

func (*Server) HasPermission Uses

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 Uses

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

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

func (*Server) RenameProject Uses

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

RenameProject renames an existing project resource in RBAC.

func (*Server) StartStatusCheck Uses

func (r *Server) StartStatusCheck()

StartStatusCheck starts a periodic status checker.

func (*Server) StopStatusCheck Uses

func (r *Server) StopStatusCheck()

StopStatusCheck stops the periodic status checker.

func (*Server) SyncProjects Uses

func (r *Server) SyncProjects() error

SyncProjects updates the list of projects in RBAC

Package rbac imports 16 packages (graph) and is imported by 3 packages. Updated 2019-05-07. Refresh now. Tools for package owners.