permissionengine

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PermissionEngine

type PermissionEngine struct {
	// contains filtered or unexported fields
}

func New

func New(entClient *ent.Client) (*PermissionEngine, error)

func (*PermissionEngine) RegisterPermission

func (pe *PermissionEngine) RegisterPermission(ctx context.Context, key string, component string, description string) (*ent.Permission, error)

func (*PermissionEngine) RequestPermission

func (pe *PermissionEngine) RequestPermission(ctx context.Context, entUser *ent.User, permissionKey string) (bool, error)

func (*PermissionEngine) SetPermissionPolicy

func (pe *PermissionEngine) SetPermissionPolicy(ctx context.Context, policyType permissionpolicy.Type, entPermission *ent.Permission, entGroup *ent.Group) (*ent.PermissionPolicy, error)

Jump to

Keyboard shortcuts

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