tableacl

package
v0.0.0-...-5f7613f Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentAclFactory

func GetCurrentAclFactory() acl.Factory

GetCurrentAclFactory returns current table acl implementation.

func GetCurrentConfig

func GetCurrentConfig() *pb.Config

GetCurrentConfig returns a copy of current tableacl configuration.

func Init

func Init(configFile string)

Init initiates table ACLs.

func InitFromProto

func InitFromProto(config *pb.Config) (err error)

InitFromProto inits table ACLs from a proto.

func Register

func Register(name string, factory acl.Factory)

Register registers a AclFactory.

func SetDefaultACL

func SetDefaultACL(name string)

SetDefaultACL sets the default ACL implementation.

Types

type ACLResult

type ACLResult struct {
	acl.ACL
	GroupName string
}

ACLResult embeds an acl.ACL and also tell which table group it belongs to.

func Authorized

func Authorized(table string, role Role) *ACLResult

Authorized returns the list of entities who have the specified role on a tablel.

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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