Documentation ¶
Index ¶
- func GetCurrentAclFactory() (acl.Factory, error)
- func GetCurrentConfig() *tableaclpb.Config
- func Init(configFile string, aclCB func()) error
- func InitFromProto(config *tableaclpb.Config) error
- func Register(name string, factory acl.Factory)
- func SetDefaultACL(name string)
- func ValidateProto(config *tableaclpb.Config) (err error)
- type ACLResult
- type Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentAclFactory ¶
GetCurrentAclFactory returns current table acl implementation.
func GetCurrentConfig ¶
func GetCurrentConfig() *tableaclpb.Config
GetCurrentConfig returns a copy of current tableacl configuration.
func Init ¶
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 ¶
func InitFromProto(config *tableaclpb.Config) error
InitFromProto inits table ACLs from a proto.
func SetDefaultACL ¶
func SetDefaultACL(name string)
SetDefaultACL sets the default ACL implementation.
func ValidateProto ¶
func ValidateProto(config *tableaclpb.Config) (err error)
ValidateProto returns an error if the given proto has problems that would cause InitFromProto to fail.
Types ¶
type ACLResult ¶
ACLResult embeds an acl.ACL and also tell which table group it belongs to.
func Authorized ¶
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
func RoleByName ¶
RoleByName returns the Role corresponding to a name