mrperms

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 5 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 struct {
	// contains filtered or unexported fields
}

func NewAccessControl added in v0.10.0

func NewAccessControl(opt AccessControlOptions) (*AccessControl, error)

func (*AccessControl) CheckPermission added in v0.10.0

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

func (*AccessControl) CheckPrivilege added in v0.10.0

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

func (*AccessControl) GuestRole added in v0.10.0

func (a *AccessControl) GuestRole() string

func (*AccessControl) HasPermission added in v0.10.0

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

func (*AccessControl) HasPrivilege added in v0.10.0

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

func (*AccessControl) NewAccessRights added in v0.10.0

func (a *AccessControl) NewAccessRights(roles ...string) mrcore.AccessRights

func (*AccessControl) RegisteredPermissions added in v0.10.0

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

func (*AccessControl) RegisteredPrivileges added in v0.10.0

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

func (*AccessControl) RegisteredRoles added in v0.10.0

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

type AccessControlOptions added in v0.10.0

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

type AppSection added in v0.10.0

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

func NewAppSection added in v0.10.0

func NewAppSection(opt AppSectionOptions) *AppSection

func (*AppSection) Audience added in v0.10.0

func (s *AppSection) Audience() string

func (*AppSection) Caption added in v0.10.0

func (s *AppSection) Caption() string

func (*AppSection) Path added in v0.10.0

func (s *AppSection) Path(actionPath string) string

func (*AppSection) Privilege added in v0.10.0

func (s *AppSection) Privilege() string

func (*AppSection) Secret added in v0.10.0

func (s *AppSection) Secret() string

type AppSectionOptions added in v0.10.0

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

type RoleGroup

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

func (*RoleGroup) CheckPermission

func (g *RoleGroup) CheckPermission(name string) bool

func (*RoleGroup) CheckPrivilege

func (g *RoleGroup) CheckPrivilege(name string) bool

func (*RoleGroup) IsGuestAccess added in v0.10.0

func (g *RoleGroup) IsGuestAccess() bool

IsGuestAccess - если ролей нет или присутствует ровно одна роль и она гостевая

Jump to

Keyboard shortcuts

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