privileges

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

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