Versions in this module Expand all Collapse all v0 v0.3.0 Aug 18, 2026 v0.2.0 Aug 6, 2026 Changes in this version + const PermMembersRead + const PermMembersWrite + const PermOrgDelete + const PermOrgsCreate + const PermWorkspaceRead + const PermWorkspaceWrite + type Config struct + Audit audit.Recorder + Log *slog.Logger + type GrantInput struct + Role string + UserID uuid.UUID + WorkspaceID uuid.UUID + type Member struct + CreatedAt time.Time + Email string + ID uuid.UUID + IsSelf bool + Manageable bool + Name string + Role string + RoleRank int32 + UserID uuid.UUID + WorkspaceID *uuid.UUID + WorkspaceName string + type Organization struct + CreatedAt time.Time + ID uuid.UUID + IsPersonal bool + Name string + Slug string + WorkspaceID uuid.UUID + WorkspaceName string + type Role struct + Description string + Name string + Rank int32 + Slug string + type Service struct + func NewService(pool *pgxpool.Pool, cfg Config) *Service + func (s *Service) ChangeRole(ctx context.Context, actor *auth.Identity, membershipID uuid.UUID, ...) error + func (s *Service) CreateOrganization(ctx context.Context, actor *auth.Identity, name string) (*Organization, error) + func (s *Service) CreateWorkspace(ctx context.Context, actor *auth.Identity, name string) (*Workspace, error) + func (s *Service) DeleteOrganization(ctx context.Context, actor *auth.Identity, id uuid.UUID) error + func (s *Service) DeleteWorkspace(ctx context.Context, actor *auth.Identity, id uuid.UUID) error + func (s *Service) Grant(ctx context.Context, actor *auth.Identity, in GrantInput) (*Member, error) + func (s *Service) Members(ctx context.Context, actor *auth.Identity) ([]Member, error) + func (s *Service) Remove(ctx context.Context, actor *auth.Identity, membershipID uuid.UUID) error + func (s *Service) RenameWorkspace(ctx context.Context, actor *auth.Identity, id uuid.UUID, name string) (*Workspace, error) + func (s *Service) Roles(ctx context.Context, actor *auth.Identity) ([]Role, error) + func (s *Service) Workspaces(ctx context.Context, actor *auth.Identity) ([]Workspace, error) + type Workspace struct + Current bool + ID uuid.UUID + Manageable bool + Name string + Slug string