import "gopkg.in/src-d/go-vitess.v1/vt/tableacl"
GetCurrentACLFactory returns current table acl implementation.
func GetCurrentConfig() *tableaclpb.Config
GetCurrentConfig returns a copy of current tableacl configuration.
Init initiates table ACLs.
The config file can be binary-proto-encoded, or json-encoded. In the json case, it looks like this:
{
"table_groups": [ { "table_names_or_prefixes": ["name1"], "readers": ["client1"], "writers": ["client1"], "admins": ["client1"] } ]
}
func InitFromProto(config *tableaclpb.Config) error
InitFromProto inits table ACLs from a proto.
Register registers an AclFactory.
SetDefaultACL sets the default ACL implementation.
func ValidateProto(config *tableaclpb.Config) (err error)
ValidateProto returns an error if the given proto has problems that would cause InitFromProto to fail.
ACLResult embeds an acl.ACL and also tell which table group it belongs to.
Authorized returns the list of entities who have the specified role on a tablel.
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 )
RoleByName returns the Role corresponding to a name
Name returns the name of a role
Path | Synopsis |
---|---|
acl | |
simpleacl | |
testlib |
Package tableacl imports 16 packages (graph) and is imported by 6 packages. Updated 2019-06-13. Refresh now. Tools for package owners.