principal

package
v0.30.45 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(subject security.Subject, ps ...security.Principal) bool

All return true if the subject possess all principals.

func Any

func Any(subject security.Subject, ps ...security.Principal) bool

Any return true if the subject possess any principals.

func Parse added in v0.30.37

func Parse[T StringPrincipal](val any) []security.Principal

Types

type Email added in v0.30.37

type Email string

Email is used to hold the email address of the subject. i.e. johm.doe@domain.com

func (*Email) InitWithTag added in v0.30.37

func (e *Email) InitWithTag(tag reflect.StructTag) error

func (Email) Name added in v0.30.37

func (e Email) Name() string

type Entitlement added in v0.30.37

type Entitlement string

Entitlement refers to the rights and privileges granted to a user or a group. i.e. createWidget

func (*Entitlement) InitWithTag added in v0.30.37

func (e *Entitlement) InitWithTag(tag reflect.StructTag) error

func (Entitlement) Name added in v0.30.37

func (e Entitlement) Name() string

type Group

type Group string

Group organizes users having common capabilities. i.e. admin

func (*Group) InitWithTag added in v0.30.6

func (g *Group) InitWithTag(tag reflect.StructTag) error

func (Group) Name added in v0.30.6

func (g Group) Name() string

type Id

type Id string

Id represents the identity of a subject. i.e. user

func (*Id) InitWithTag added in v0.30.6

func (i *Id) InitWithTag(tag reflect.StructTag) error

func (Id) Name added in v0.30.6

func (i Id) Name() string

type Role

type Role string

Role represents a certain level of authorization. i.e. operator

func (*Role) InitWithTag added in v0.30.6

func (r *Role) InitWithTag(tag reflect.StructTag) error

func (Role) Name added in v0.30.6

func (r Role) Name() string

type StringPrincipal added in v0.30.37

type StringPrincipal interface {
	~string
	security.Principal
}

StringPrincipal is a generic constraint for string based security.Principal.

type User

type User string

User identifies a username or account name. i.e. test1

func (*User) InitWithTag added in v0.30.6

func (u *User) InitWithTag(tag reflect.StructTag) error

func (User) Name added in v0.30.6

func (u User) Name() string

Jump to

Keyboard shortcuts

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