tableacl

package
v0.0.0-...-2166858 Latest Latest
Warning

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

Go to latest
Published: May 28, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALL = "*"
)

Variables

This section is empty.

Functions

func Init

func Init(configFile string)

Init initiates table ACLs

Types

type ACL

type ACL interface {
	// IsMember checks the membership of a principal in this ACL
	IsMember(principal string) bool
}

ACL is an interface for Access Control List

func Authorized

func Authorized(table string, minRole Role) ACL

Authorized returns the list of entities who have at least the minimum specified Role on a table

func NewACL

func NewACL(entries []string) (ACL, error)

NewACL returns an ACL with the specified entries

type Role

type Role int

Role defines the level of access on a table

const (
	// READER can run SELECT statements
	READER Role = iota
	// WRITER can run SELECT, INSERT & UPDATE statements
	WRITER
	// ADMIN can run any statements including DDLs
	ADMIN
	// NumRoles is number of Roles defined
	NumRoles
)

func RoleByName

func RoleByName(s string) (Role, bool)

RoleByName returns the Role corresponding to a name

func (Role) Name

func (r Role) Name() string

Name returns the name of a role

Jump to

Keyboard shortcuts

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