privilege

package
v0.0.0-...-40faf7d Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindPrivilegeChecker

func BindPrivilegeChecker(ctx context.Context, pc Checker)

BindPrivilegeChecker binds Checker to context.

Types

type Checker

type Checker interface {
	// Check checks privilege.
	// If tbl is nil, only check global/db scope privileges.
	// If tbl is not nil, check global/db/table scope privileges.
	Check(ctx context.Context, db *model.DBInfo, tbl *model.TableInfo, privilege mysql.PrivilegeType) (bool, error)
	// Show granted privileges for user.
	ShowGrants(ctx context.Context, user string) ([]string, error)
}

Checker is the interface for check privileges.

func GetPrivilegeChecker

func GetPrivilegeChecker(ctx context.Context) Checker

GetPrivilegeChecker gets Checker from context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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