access

package
v2.167.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ModelConfig = `` /* 235-byte string literal not displayed */

ModelConfig defines the RBAC used.

Variables

This section is empty.

Functions

This section is empty.

Types

type CasbinController added in v2.31.0

type CasbinController struct {
	*casbin.Enforcer
}

CasbinController for access.

func (*CasbinController) HasAccess added in v2.31.0

func (c *CasbinController) HasAccess(user, permission string) (bool, error)

HasAccess just calls Enforce.

type Config

type Config struct {
	Policy string `yaml:"policy,omitempty" json:"policy,omitempty" toml:"policy,omitempty"`
}

Config for access.

func (*Config) IsEnabled added in v2.115.0

func (c *Config) IsEnabled() bool

IsEnabled for access.

type Controller

type Controller interface {
	// HasAccess checks if the user can access the system with action.
	HasAccess(user, permission string) (bool, error)
}

Controller allows to check different kinds of accesses.

func NewController

func NewController(cfg *Config) (Controller, error)

NewController for access.

Jump to

Keyboard shortcuts

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