acl

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadRoles

func LoadRoles() (string, error)

Types

type NewRoleOpts

type NewRoleOpts struct {
	Name          string
	Permissions   []string
	CanAddInUsers bool
	IsSystemRole  bool
}

type Role

type Role struct {
	Name          string   `json:"name"`
	Permissions   []string `json:"permissions"`
	CanAddInUsers bool     `json:"canAddInUsers"`
	IsSystemRole  bool     `json:"isSystemRole"`
}

func NewRole

func NewRole(opts *NewRoleOpts) (*Role, error)

func (*Role) AddPermission

func (r *Role) AddPermission(permission string)

func (*Role) Can

func (r *Role) Can(permission string) bool

func (*Role) RemovePermission

func (r *Role) RemovePermission(permission string)

Jump to

Keyboard shortcuts

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