Documentation ¶
Index ¶
- func UserHasPermission(r *http.Request, project string, permission string) bool
- func UserIsAdmin(r *http.Request) bool
- type Server
- func (r *Server) AddProject(id int64, name string) error
- func (r *Server) DeleteProject(id int64) error
- func (r *Server) RenameProject(id int64, name string) error
- func (r *Server) StartStatusCheck()
- func (r *Server) StopStatusCheck()
- func (r *Server) SyncProjects() error
- func (r *Server) UserAccess(username string) (*UserAccess, error)
- type UserAccess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserHasPermission ¶
UserHasPermission checks whether the requestor has a specific permission on a project.
func UserIsAdmin ¶
UserIsAdmin checks whether the requestor is a global admin.
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 ¶
AddProject adds a new project resource to RBAC.
func (*Server) DeleteProject ¶
DeleteProject adds a new project resource to RBAC.
func (*Server) RenameProject ¶
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 ¶
SyncProjects updates the list of projects in RBAC
func (*Server) UserAccess ¶
func (r *Server) UserAccess(username string) (*UserAccess, error)
UserAccess returns a UserAccess struct for the user.
type UserAccess ¶
UserAccess struct for permission checks.
Click to show internal directories.
Click to hide internal directories.