casbin

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type EnforcerProvider

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

func NewEnforcerProvider

func NewEnforcerProvider(logger klog.Logger, dbProvider sgorm.DbProvider, dbKey string) (*EnforcerProvider, error)

func (*EnforcerProvider) Get

func (p *EnforcerProvider) Get(ctx context.Context) (*casbin.SyncedEnforcer, error)

type PermissionService

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

func NewPermissionService

func NewPermissionService(enforcer *EnforcerProvider) *PermissionService

func (*PermissionService) AddGrant

func (p *PermissionService) AddGrant(ctx context.Context, resource authz.Resource, action authz.Action, subject authz.Subject, tenantID string, effect authz.Effect) error

func (*PermissionService) IsGrantTenant

func (p *PermissionService) IsGrantTenant(ctx context.Context, requirements authz.RequirementList, tenantID string, subjects ...authz.Subject) ([]authz.Effect, error)

func (*PermissionService) ListAcl

func (p *PermissionService) ListAcl(ctx context.Context, subjects ...authz.Subject) ([]authz.PermissionBean, error)

func (*PermissionService) RemoveGrant

func (p *PermissionService) RemoveGrant(ctx context.Context, subject authz.Subject, filter ...authz.FilterFunc) error

func (*PermissionService) UpdateGrant

func (p *PermissionService) UpdateGrant(ctx context.Context, subject authz.Subject, acl []authz.UpdateSubjectPermission) error

Jump to

Keyboard shortcuts

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