Versions in this module Expand all Collapse all v0 v0.98.0 Apr 23, 2026 Changes in this version + var ErrAlreadyMember = errors.New("principal is already a member of this resource") + var ErrInvalidOrgRole = errors.New("role is not valid for organization scope") + var ErrInvalidPrincipal = errors.New("invalid principal") + var ErrInvalidPrincipalType = errors.New("unsupported principal type") + var ErrInvalidProjectRole = errors.New("role is not valid for project scope") + var ErrLastOwnerRole = errors.New("cannot change role: this is the last owner of the organization") + var ErrNotMember = errors.New("principal is not a member of this resource") + var ErrNotOrgMember = errors.New("principal is not a member of the organization") + var ErrPrincipalNotInOrg = errors.New("principal does not belong to this organization") + type AuditRecordRepository interface + Create func(ctx context.Context, auditRecord auditrecord.AuditRecord) (auditrecord.AuditRecord, error) + type GroupService interface + Get func(ctx context.Context, idOrName string) (group.Group, error) + List func(ctx context.Context, flt group.Filter) ([]group.Group, error) + type OrgService interface + Get func(ctx context.Context, idOrName string) (organization.Organization, error) + type PolicyService interface + Create func(ctx context.Context, pol policy.Policy) (policy.Policy, error) + Delete func(ctx context.Context, id string) error + List func(ctx context.Context, flt policy.Filter) ([]policy.Policy, error) + type ProjectService interface + Get func(ctx context.Context, idOrName string) (project.Project, error) + List func(ctx context.Context, flt project.Filter) ([]project.Project, error) + type RelationService interface + Create func(ctx context.Context, rel relation.Relation) (relation.Relation, error) + Delete func(ctx context.Context, rel relation.Relation) error + type RoleService interface + Get func(ctx context.Context, idOrName string) (role.Role, error) + type Service struct + func NewService(logger log.Logger, policyService PolicyService, ...) *Service + func (s *Service) AddOrganizationMember(ctx context.Context, orgID, principalID, principalType, roleID string) error + func (s *Service) RemoveOrganizationMember(ctx context.Context, orgID, principalID, principalType string) error + func (s *Service) RemoveProjectMember(ctx context.Context, projectID, principalID, principalType string) error + func (s *Service) SetOrganizationMemberRole(ctx context.Context, orgID, principalID, principalType, roleID string) error + func (s *Service) SetProjectMemberRole(ctx context.Context, projectID, principalID, principalType, roleID string) error + type ServiceuserService interface + Get func(ctx context.Context, id string) (serviceuser.ServiceUser, error) + type UserService interface + GetByID func(ctx context.Context, id string) (user.User, error)