Documentation ¶
Index ¶
- Constants
- Variables
- type AuthnService
- type Filter
- type Organization
- type PolicyService
- type PreferencesService
- type RelationService
- type Repository
- type Service
- func (s Service) AddMember(ctx context.Context, orgID, relationName string, ...) error
- func (s Service) AddUsers(ctx context.Context, orgID string, userIDs []string) error
- func (s Service) AttachToPlatform(ctx context.Context, orgID string) error
- func (s Service) Create(ctx context.Context, org Organization) (Organization, error)
- func (s Service) DeleteModel(ctx context.Context, id string) error
- func (s Service) Disable(ctx context.Context, id string) error
- func (s Service) Enable(ctx context.Context, id string) error
- func (s Service) Get(ctx context.Context, idOrName string) (Organization, error)
- func (s Service) GetDefaultOrgStateOnCreate(ctx context.Context) (State, error)
- func (s Service) GetRaw(ctx context.Context, idOrName string) (Organization, error)
- func (s Service) List(ctx context.Context, f Filter) ([]Organization, error)
- func (s Service) ListByUser(ctx context.Context, principal authenticate.Principal, filter Filter) ([]Organization, error)
- func (s Service) MemberCount(ctx context.Context, orgID string) (int64, error)
- func (s Service) RemoveUsers(ctx context.Context, orgID string, userIDs []string) error
- func (s Service) Update(ctx context.Context, org Organization) (Organization, error)
- type State
- type UserService
Constants ¶
View Source
const ( Enabled State = "enabled" Disabled State = "disabled" AdminPermission = schema.UpdatePermission AdminRelation = schema.OwnerRelationName AdminRole = schema.RoleOrganizationOwner MemberRole = schema.RoleOrganizationViewer )
Variables ¶
View Source
var ( ErrNotExist = errors.New("org doesn't exist") ErrInvalidUUID = errors.New("invalid syntax of uuid") ErrInvalidID = errors.New("org id is invalid") ErrConflict = errors.New("org already exist") ErrInvalidDetail = errors.New("invalid org detail") ErrDisabled = errors.New("org is disabled") )
Functions ¶
This section is empty.
Types ¶
type AuthnService ¶
type AuthnService interface {
GetPrincipal(ctx context.Context, via ...authenticate.ClientAssertion) (authenticate.Principal, error)
}
type Filter ¶
type Filter struct { UserID string IDs []string State State Pagination *pagination.Pagination }
type Organization ¶
type PolicyService ¶ added in v0.7.12
type PreferencesService ¶ added in v0.7.13
type RelationService ¶
type Repository ¶
type Repository interface { GetByID(ctx context.Context, id string) (Organization, error) GetByIDs(ctx context.Context, ids []string) ([]Organization, error) GetByName(ctx context.Context, name string) (Organization, error) Create(ctx context.Context, org Organization) (Organization, error) List(ctx context.Context, flt Filter) ([]Organization, error) UpdateByID(ctx context.Context, org Organization) (Organization, error) UpdateByName(ctx context.Context, org Organization) (Organization, error) SetState(ctx context.Context, id string, state State) error Delete(ctx context.Context, id string) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository, relationService RelationService, userService UserService, authnService AuthnService, policyService PolicyService, prefService PreferencesService) *Service
func (Service) AttachToPlatform ¶
func (Service) Create ¶
func (s Service) Create(ctx context.Context, org Organization) (Organization, error)
func (Service) DeleteModel ¶
DeleteModel doesn't delete the nested resource, only itself
func (Service) Get ¶
Get returns an enabled organization by id or name. Will return `org is disabled` error if the organization is disabled
func (Service) GetDefaultOrgStateOnCreate ¶ added in v0.7.13
GetDefaultOrgStateOnCreate gets from preferences if we need to disable org on create
func (Service) GetRaw ¶ added in v0.7.5
GetRaw returns an organization(both enabled and disabled) by id or name
func (Service) ListByUser ¶
func (s Service) ListByUser(ctx context.Context, principal authenticate.Principal, filter Filter) ([]Organization, error)
func (Service) MemberCount ¶ added in v0.8.13
func (Service) RemoveUsers ¶
RemoveUsers removes users from an organization as members it doesn't remove user access to projects or other resources provided by policies, don't call directly, use cascade deleter
func (Service) Update ¶
func (s Service) Update(ctx context.Context, org Organization) (Organization, error)
Click to show internal directories.
Click to hide internal directories.