permissions

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code string

Code is a string representing a OB access permission

type CodeSet

type CodeSet []Code

CodeSet is a set of OB code permissions

func NoCodeSet

func NoCodeSet() CodeSet

NoCodeSet represents empty or no permissions set

func StringSliceToCodeSet

func StringSliceToCodeSet(s []string) CodeSet

StringSliceToCodeSet -

func (CodeSet) Equals

func (c CodeSet) Equals(otherSet CodeSet) bool

Equals check if 2 sets have the SAME codes

func (CodeSet) Has

func (c CodeSet) Has(searchCode Code) bool

Has check if a set Has a code

func (CodeSet) HasAll

func (c CodeSet) HasAll(otherSet CodeSet) bool

HasAll check is a set has all codes in other set

func (CodeSet) HasAny

func (c CodeSet) HasAny(otherSet CodeSet) bool

HasAny checks if has any of the codes of other set

func (CodeSet) Union

func (c CodeSet) Union(otherSet CodeSet) CodeSet

add returns a new set with all Code from 2 sets

type CodeSetResult

type CodeSetResult struct {
	CodeSet CodeSet  `json:"codes"`
	TestIds []TestId `json:"testIds"`
}

CodeSetResult represents one set of permissions that are valid for a set of test ids

type CodeSetResultSet

type CodeSetResultSet []CodeSetResult

CodeSetResultSet represents all permissions sets and their respective test id

func Resolver

func Resolver(groups []Group) CodeSetResultSet

Resolver find minimal codeSet required to satisfy a set Group of permissions (endpoints)

type Group

type Group struct {
	TestId   TestId
	Included CodeSet
	Excluded CodeSet
}

Group represents a test and it's context permission set config

func NewGroup

func NewGroup(testId string, included, excluded CodeSet) Group

type TestId

type TestId string

func StringSliceToTestID

func StringSliceToTestID(s []string) []TestId

StringSliceToTestID -

Jump to

Keyboard shortcuts

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