Skip to main content

permissions

permissions

import "github.com/cloudfoundry/go-cf-api/internal/apicommon/v3/permissions"

Index

Variables

var (
// The UNION requires that all the tables have the same schema so just pick one to use the column names from
spaceIDColumn = models.Quote(models.SpacesDeveloperColumns.SpaceID)
userIDColumn = models.Quote(models.SpacesDeveloperColumns.UserID)
organizationIDColumn = models.Quote(models.OrganizationsManagerColumns.OrganizationID)
orgRolesColumns = fmt.Sprintf("%s, %s",
models.Quote(models.OrganizationsManagerColumns.OrganizationID),
models.Quote(models.OrganizationsManagerColumns.UserID))
orgRolesTable = models.Quote("org_roles")
allowedSpaceIDsTable = models.Quote("allowed_space_ids")

AllSpaceRoles = []Role{SpaceDeveloper, SpaceSupporter, SpaceManager, SpaceAuditor}
AllOrgRoles = []Role{OrgManager, OrgBillingManager, OrgAuditor}
)

type AllowedSpaceIDs

type AllowedSpaceIDs interface {
With() []qm.QueryMod
Contains(column string) qm.QueryMod
}

type Querier

type Querier interface {
AllowedSpaceIDsForUser(userGUID string, roles ...Role) (AllowedSpaceIDs, error)
}

type Role

type Role string
const (
SpaceDeveloper Role = "SpaceDeveloper"
SpaceSupporter Role = "SpaceSupporter"
SpaceManager Role = "SpaceManager"
SpaceAuditor Role = "SpaceAuditor"
OrgAuditor Role = "OrgAuditor"
OrgBillingManager Role = "OrgBillingManager"
OrgManager Role = "OrgManager"
)

type allowedSpaceIDs

type allowedSpaceIDs struct {
userGUID string
tableName string
tableExpression *models.Subquery
orgRolesTableName string
orgRowsTableExpression *models.Subquery
}

func (*allowedSpaceIDs) Contains

func (ws *allowedSpaceIDs) Contains(column string) qm.QueryMod

func (*allowedSpaceIDs) With

func (ws *allowedSpaceIDs) With() []qm.QueryMod

type querier

type querier struct{}

func NewQuerier

func NewQuerier() *querier

func (*querier) AllowedSpaceIDsForUser

func (q *querier) AllowedSpaceIDsForUser(userGUID string, roles ...Role) (AllowedSpaceIDs, error)

Generated by gomarkdoc