model

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CanView allows read-only access to an object
	CanView = "can_view"
	// CanEdit allows read and write access to an object
	CanEdit = "can_edit"
	// CanDelete allows deletion of an object
	CanDelete = "can_delete"
)
View Source
var (
	// Read is an alias for can_view
	Read = "read"
	// Write is an alias for can_edit
	Write = "write"
	// Delete is an alias for can_delete
	Delete = "delete"
)

Functions

func CreateOptions

func CreateOptions() ([]string, error)

CreateOptions returns objects with verbs that support creation

func DefaultServiceScopeSet

func DefaultServiceScopeSet() (map[string]struct{}, error)

DefaultServiceScopeSet returns the default service scopes as a set

func GetCrudAuthorizationModel

func GetCrudAuthorizationModel() (*openfga.AuthorizationModel, error)

GetAuthorizationModel returns the parsed embedded authorization model

func GetRolesAuthorizationModel

func GetRolesAuthorizationModel() (*openfga.AuthorizationModel, error)

func NormalizeScope

func NormalizeScope(scope string) string

NormalizeScope returns the relation name for a provided scope, handling common aliases Accepts object:verb (e.g., control:write) and simple verbs (read/write/delete)

func RelationsForService

func RelationsForService() ([]string, error)

RelationsForService returns relations shaped like can_<verb>_<object> that directly accept service subjects.

func RoleOptions

func RoleOptions() ([]string, error)

RoleOptions returns objects with verbs that support roles

func ScopeAliases

func ScopeAliases() map[string]string

ScopeAliases returns a copy of the supported alias mapping

func ScopeOptions

func ScopeOptions() (map[string][]string, error)

ScopeOptions groups available scopes by object (verb mapped back via alias map)

Types

This section is empty.

Jump to

Keyboard shortcuts

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