Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPrivileges ¶
func LoadPrivileges() ([]*grant_tables.User, []*grant_tables.RoleEdge, error)
LoadPrivileges reads the file previously set on the file path and returns the privileges and role connections. If the file path has not been set, returns an empty slice for both, but does not error. This is so that the logic path can retain the calls regardless of whether a user wants privileges to be loaded or persisted.
func SavePrivileges ¶
func SavePrivileges(ctx *sql.Context, users []*grant_tables.User, roles []*grant_tables.RoleEdge) error
SavePrivileges implements the interface grant_tables.PersistCallback. This is used to save privileges to disk. If the file path has not been previously set, this returns without error. This is so that the logic path can retain the calls regardless of whether a user wants privileges to be loaded or persisted.
func SetFilePath ¶
func SetFilePath(fp string)
SetFilePath sets the file path that will be used for saving and loading privileges.
Types ¶
This section is empty.