mrperms

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControl added in v0.10.0

type AccessControl interface {
	NewAccessRights(members ...string) AccessRights
	HasPrivilege(name string) bool
	HasPermission(name string) bool
}

type AccessControlOptions added in v0.10.0

type AccessControlOptions struct {
	RolesDirPath  string
	RolesFileType string
	Roles         []string
	Privileges    []string
	Permissions   []string
	GuestRole     string // optional
}

type AccessRights added in v0.13.0

type AccessRights interface {
	IsGuestAccess() bool
	CheckPrivilege(name string) bool
	CheckPermission(name string) bool
}

type AppSection added in v0.10.0

type AppSection interface {
	Caption() string
	Path(actionPath string) string
	Privilege() string
	Secret() string
	Audience() string
}

func NewAppSection added in v0.10.0

func NewAppSection(opts AppSectionOptions) AppSection

type AppSectionOptions added in v0.10.0

type AppSectionOptions struct {
	Caption      string
	RootPath     string
	Privilege    string
	AuthSecret   string
	AuthAudience string
}

type RoleAccessControl added in v0.13.0

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

func NewAccessControl added in v0.10.0

func NewAccessControl(opts AccessControlOptions) (*RoleAccessControl, error)

func (*RoleAccessControl) CheckPermission added in v0.13.0

func (a *RoleAccessControl) CheckPermission(rolesIDs []uint16, name string) bool

func (*RoleAccessControl) CheckPrivilege added in v0.13.0

func (a *RoleAccessControl) CheckPrivilege(rolesIDs []uint16, name string) bool

func (*RoleAccessControl) GuestRole added in v0.13.0

func (a *RoleAccessControl) GuestRole() string

func (*RoleAccessControl) HasPermission added in v0.13.0

func (a *RoleAccessControl) HasPermission(name string) bool

func (*RoleAccessControl) HasPrivilege added in v0.13.0

func (a *RoleAccessControl) HasPrivilege(name string) bool

func (*RoleAccessControl) NewAccessRights added in v0.13.0

func (a *RoleAccessControl) NewAccessRights(roles ...string) AccessRights

func (*RoleAccessControl) RegisteredPermissions added in v0.13.0

func (a *RoleAccessControl) RegisteredPermissions() []string

func (*RoleAccessControl) RegisteredPrivileges added in v0.13.0

func (a *RoleAccessControl) RegisteredPrivileges() []string

func (*RoleAccessControl) RegisteredRoles added in v0.13.0

func (a *RoleAccessControl) RegisteredRoles() []string

Jump to

Keyboard shortcuts

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