rbac

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoadOptions = struct {
	Default          LoadOptionFunc
	LoadRBACGlobal   LoadOptionFunc
	LoadRBACProject  LoadOptionFunc
	LoadRBACHatchery LoadOptionFunc
	LoadRBACRegion   LoadOptionFunc
	LoadRBACWorkflow LoadOptionFunc
	All              LoadOptionFunc
}{
	Default:          loadDefault,
	LoadRBACGlobal:   loadRBACGlobal,
	LoadRBACProject:  loadRBACProject,
	LoadRBACHatchery: loadRBACHatchery,
	LoadRBACRegion:   loadRBACRegion,
	LoadRBACWorkflow: loadRBACWorkflow,
	All:              loadAll,
}

LoadOptions provides all options on rbac loads functions

Functions

func HasGlobalRole

func HasGlobalRole(ctx context.Context, db gorp.SqlExecutor, role string, userID string) (bool, error)

func HasRoleOnProjectAndUserID

func HasRoleOnProjectAndUserID(ctx context.Context, db gorp.SqlExecutor, role string, userID string, projectKey string) (bool, error)

func HasRoleOnWorkflowAndUserID added in v0.53.0

func HasRoleOnWorkflowAndUserID(ctx context.Context, db gorp.SqlExecutor, role string, userID string, projectKey string, workflowName string) (bool, error)

func Insert

Insert a RBAC permission in database

func IsValidRBAC added in v0.53.0

func IsValidRBAC(ctx context.Context, db gorp.SqlExecutor, rbac *sdk.RBAC) error

func LoadAll added in v0.53.1

func LoadAll(ctx context.Context, db gorp.SqlExecutor) ([]sdk.RBAC, error)

func LoadAllProjectKeysAllowed added in v0.53.0

func LoadAllProjectKeysAllowed(ctx context.Context, db gorp.SqlExecutor, role string, userID string) (sdk.StringSlice, error)

func LoadAllWorkflowsAllowed added in v0.53.0

func LoadAllWorkflowsAllowed(ctx context.Context, db gorp.SqlExecutor, role string, projectKey string, userID string) (sdk.StringSlice, bool, error)

func LoadRBACByHatcheryID added in v0.53.0

func LoadRBACByHatcheryID(ctx context.Context, db gorp.SqlExecutor, hatcheryID string) (*sdk.RBAC, error)

func LoadRBACByID added in v0.53.0

func LoadRBACByID(ctx context.Context, db gorp.SqlExecutor, id string, opts ...LoadOptionFunc) (*sdk.RBAC, error)

func LoadRBACByIDs added in v0.53.0

func LoadRBACByIDs(ctx context.Context, db gorp.SqlExecutor, IDs sdk.StringSlice, opts ...LoadOptionFunc) ([]sdk.RBAC, error)

func LoadRBACByName

func LoadRBACByName(ctx context.Context, db gorp.SqlExecutor, name string, opts ...LoadOptionFunc) (*sdk.RBAC, error)

func LoadRBACByRegionID added in v0.53.0

func LoadRBACByRegionID(ctx context.Context, db gorp.SqlExecutor, regionID string) ([]sdk.RBAC, error)

func LoadRBACHatcheryByHatcheryID added in v0.53.0

func LoadRBACHatcheryByHatcheryID(ctx context.Context, db gorp.SqlExecutor, hatcheryID string) (*sdk.RBACHatchery, error)

func LoadRBACRegionOrganizations added in v0.53.0

func LoadRBACRegionOrganizations(ctx context.Context, db gorp.SqlExecutor, rbacRegion *sdk.RBACRegion) error

func LoadRegionIDsByRoleAndUserID added in v0.53.0

func LoadRegionIDsByRoleAndUserID(ctx context.Context, db gorp.SqlExecutor, role string, userID string) ([]sdk.RBACRegion, error)

func Update

Types

type LoadOptionFunc

type LoadOptionFunc func(context.Context, gorp.SqlExecutor, *rbac) error

LoadOptionFunc is used as options to loadProject functions

Jump to

Keyboard shortcuts

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