group

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: AGPL-3.0 Imports: 1 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserHasGroupMembership

func UserHasGroupMembership(r []Record, groupID, userID string) bool

UserHasGroupMembership returns true if user belongs to specified group.

Types

type Group

type Group struct {
	model.BaseEntity
	OrgID   string `json:"orgId"`
	Name    string `json:"name"`
	Purpose string `json:"purpose"`
	Members int    `json:"members"` // read-only info
}

Group defines a user group.

type Member

type Member struct {
	ID        uint64 `json:"id"`
	OrgID     string `json:"orgId"`
	GroupID   string `json:"groupId"`
	UserID    string `json:"userId"`
	Firstname string `json:"firstname"` //read-only info
	Lastname  string `json:"lastname"`  //read-only info
}

Member defines user membership of a user group.

type Record

type Record struct {
	ID      uint64 `json:"id"`
	OrgID   string `json:"orgId"`
	GroupID string `json:"groupId"`
	UserID  string `json:"userId"`
	Name    string `json:"name"`
	Purpose string `json:"purpose"`
}

Record details user membership of a user group.

func FilterGroupRecords

func FilterGroupRecords(r []Record, groupID string) (m []Record)

FilterGroupRecords returns only those records matching group ID.

Jump to

Keyboard shortcuts

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