admin

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages all admin transactions

func New

func New() *Manager

New creates a new admin manager instance

func (*Manager) IsAdminOpAuthorised

func (m *Manager) IsAdminOpAuthorised(token, scope string) (int, error)

IsAdminOpAuthorised checks if the admin operation is authorised. TODO add scope level restrictions as well

func (*Manager) IsTokenValid

func (m *Manager) IsTokenValid(token string) error

IsTokenValid checks if the token is valid

func (*Manager) Login

func (m *Manager) Login(user, pass string) (int, string, error)

Login handles the admin login operation

func (*Manager) SetConfig

func (m *Manager) SetConfig(admin *config.Admin)

SetConfig sets the admin config

func (*Manager) ValidateSyncOperation

func (m *Manager) ValidateSyncOperation(c *config.Config, project *config.Project) bool

ValidateSyncOperation validates if an operation is permitted based on the mode

Jump to

Keyboard shortcuts

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