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 )
Click to show internal directories.
Click to hide internal directories.