groups

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BLANK = "'blank'"
View Source
const DoorName = schema.DoorName
View Source
const GroupCreated = schema.Created
View Source
const GroupDeleted = schema.Deleted
View Source
const GroupDoors = schema.GroupDoors
View Source
const GroupModified = schema.Modified
View Source
const GroupName = schema.GroupName
View Source
const GroupStatus = schema.Status

Variables

This section is empty.

Functions

func CanAdd added in v0.8.3

func CanAdd[T TAuthable](a auth.OpAuth, u T) error

func CanDelete added in v0.8.3

func CanDelete[T TAuthable](a auth.OpAuth, u T) error

func CanUpdate added in v0.8.3

func CanUpdate[T TAuthable](a auth.OpAuth, u T, field string, value any) error

func CanView added in v0.8.3

func CanView[T TAuthable](a auth.OpAuth, u T, field string, value any) error

Types

type Group

type Group struct {
	catalog.CatalogGroup
	Name  string              `json:"name"`
	Doors map[schema.OID]bool `json:"doors"`
	// contains filtered or unexported fields
}

func (*Group) AsObjects

func (g *Group) AsObjects(a *auth.Authorizator) []schema.Object

func (Group) AsRuleEntity

func (g Group) AsRuleEntity() (string, interface{})

func (Group) IsDeleted

func (g Group) IsDeleted() bool

func (Group) IsValid

func (g Group) IsValid() bool

func (Group) Status

func (g Group) Status() types.Status

func (Group) String

func (g Group) String() string

type Groups

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

func NewGroups

func NewGroups() Groups

func (*Groups) AsObjects

func (gg *Groups) AsObjects(a *auth.Authorizator) []schema.Object

func (*Groups) Clone

func (gg *Groups) Clone() Groups

NTS: 'added' is specifically not cloned - it has a lifetime for the duration of

the 'shadow' copy only

NTS: 'added' is specifically not cloned - it has a lifetime for the duration of

the 'shadow' copy only

func (*Groups) Create

func (gg *Groups) Create(a *auth.Authorizator, oid schema.OID, value string, dbc db.DBC) ([]schema.Object, error)

func (*Groups) Delete

func (gg *Groups) Delete(auth *auth.Authorizator, oid schema.OID, dbc db.DBC) ([]schema.Object, error)

func (Groups) Doors

func (gg Groups) Doors(groups ...schema.OID) []schema.OID

func (*Groups) Group

func (gg *Groups) Group(oid schema.OID) (Group, bool)

func (*Groups) Load

func (gg *Groups) Load(blob json.RawMessage) error

func (Groups) Print

func (gg Groups) Print()

func (Groups) Save

func (gg Groups) Save() (json.RawMessage, error)

func (*Groups) Sweep

func (gg *Groups) Sweep(retention time.Duration)

func (*Groups) Update

func (gg *Groups) Update(a *auth.Authorizator, oid schema.OID, value string, dbc db.DBC) ([]schema.Object, error)

func (Groups) Validate

func (gg Groups) Validate() error

type TAuthable added in v0.8.3

type TAuthable interface {
	Group | *Group

	AsRuleEntity() (string, any)
}

Jump to

Keyboard shortcuts

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