Documentation ¶
Index ¶
- func GetCurrentAclFactory() (acl.Factory, error)
- func GetCurrentConfig() *tableaclpb.Config
- func Init(configFile string, aclCB func()) error
- func InitFromProto(config *tableaclpb.Config) (err error)
- func Register(name string, factory acl.Factory)
- func SetDefaultACL(name string)
- 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) (err error)
InitFromProto inits table ACLs from a proto.
func SetDefaultACL ¶
func SetDefaultACL(name string)
SetDefaultACL sets the default ACL implementation.
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
Click to show internal directories.
Click to hide internal directories.