permissions

package
v0.381.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

type Value struct {
	Type        ValueType
	StringValue string // Set if Type is ValueString
	NumberValue int    // Set if Type is ValueNumber
	HeaderKey   string // Set if Type is ValueHeader
	SecretKey   string // Set if Type is ValueSecret
}

func ToSQL

func ToSQL(s *proto.Schema, m *proto.Model, action *proto.Action) (sql string, values []*Value, err error)

ToSQL creates a single SQL query that can be run to determine if permission is granted for the given action and a set of records.

The returned SQL uses "?" placeholders for values and the returned list of values indicates what values should be provided to the query at runtime.

type ValueType

type ValueType int
const (
	ValueIdentityID      ValueType = iota // Identity ID of caller
	ValueIdentityEmail                    // Identity email of caller
	ValueIsAuthenticated                  // Is authenticated flag
	ValueNow                              // Current timestamp
	ValueHeader                           // Header value
	ValueSecret                           // Secret value
	ValueString                           // A string literal
	ValueNumber                           // A number literal
	ValueRecordIDs                        // The ID's of the records to check permission for
)

Jump to

Keyboard shortcuts

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