rbac

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: BSD-3-Clause Imports: 15 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
	LoadRBACVariableSet   LoadOptionFunc
	LoadRbacRegionProject LoadOptionFunc
	All                   LoadOptionFunc
}{
	Default:               loadDefault,
	LoadRBACGlobal:        loadRBACGlobal,
	LoadRBACProject:       loadRBACProject,
	LoadRBACHatchery:      loadRBACHatchery,
	LoadRBACRegion:        loadRBACRegion,
	LoadRBACWorkflow:      loadRBACWorkflow,
	LoadRBACVariableSet:   loadRBACVariableSet,
	LoadRbacRegionProject: loadRBACRegionProject,
	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 HasRoleOnProjectAndVCSUser added in v0.55.1

func HasRoleOnProjectAndVCSUser(ctx context.Context, db gorp.SqlExecutor, role string, user sdk.RBACVCSUser, projectKey string) (bool, error)

func HasRoleOnRegionProject added in v0.55.0

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

func HasRoleOnVariableSetAndUserID added in v0.55.0

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

func HasRoleOnVariableSetsAndUserID added in v0.55.0

func HasRoleOnVariableSetsAndUserID(ctx context.Context, db gorp.SqlExecutor, role string, userID string, projectKey string, vsNames []string) (bool, string, error)

func HasRoleOnVariableSetsAndVCSUser added in v0.55.1

func HasRoleOnVariableSetsAndVCSUser(ctx context.Context, db gorp.SqlExecutor, role string, user sdk.RBACVCSUser, projectKey string, vsNames []string) (bool, string, error)

func HasRoleOnWorkflowAndUserID added in v0.53.0

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

func HasRoleOnWorkflowAndVCSUsername added in v0.55.1

func HasRoleOnWorkflowAndVCSUsername(ctx context.Context, db gorp.SqlExecutor, role string, VCSUser sdk.RBACVCSUser, projectKey string, vcs, repo, 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 LoadAllProjectKeysAllowedForVCSUser added in v0.55.1

func LoadAllProjectKeysAllowedForVCSUser(ctx context.Context, db gorp.SqlExecutor, role string, user sdk.RBACVCSUser) (sdk.StringSlice, error)

func LoadAllVariableSetsAllowed added in v0.55.0

func LoadAllVariableSetsAllowed(ctx context.Context, db gorp.SqlExecutor, role string, projectKey string, userID string) (sdk.StringSlice, bool, 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 LoadAllWorkflowsAllowedForVCSUSer added in v0.55.1

func LoadAllWorkflowsAllowedForVCSUSer(ctx context.Context, db gorp.SqlExecutor, role string, projectKey string, user sdk.RBACVCSUser) (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 LoadRegionIDsByRoleAndVCSUSer added in v0.55.1

func LoadRegionIDsByRoleAndVCSUSer(ctx context.Context, db gorp.SqlExecutor, role string, user sdk.RBACVCSUser) ([]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