model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleAdmin  = "admin"
	RoleMember = "member"
	RoleOwner  = "owner"
)

Base role values — the actual strings stored in the database.

View Source
const (
	OrgRoleAdmin  = RoleAdmin  // org admin — can manage teams, members, VKs
	OrgRoleMember = RoleMember // org member — read-only access to org info
	OrgRoleOwner  = RoleOwner  // org owner/creator — full org control
)

Org-specific role aliases — semantically scoped to organization membership.

View Source
const (
	TeamRoleAdmin  = RoleAdmin  // team admin — can manage members, VKs
	TeamRoleMember = RoleMember // team member — read-only access to team info
)

Team-specific role aliases — semantically scoped to team membership.

View Source
const (
	ResolvedRoleOrgAdmin   = "org_admin"
	ResolvedRoleTeamAdmin  = "team_admin"
	ResolvedRoleTeamMember = "team_member"
)

Resolved role values — set by middleware on the request context to indicate the *effective* role that authorized the request. These differ from DB-level roles: "org_admin" implies team_admin for any team in the org, "team_admin" is direct team admin, etc.

Variables

This section is empty.

Functions

func IsOrgAdminRole

func IsOrgAdminRole(role string) bool

isOrgAdminRole returns true if the given DB-level role string represents an org admin or owner (both have admin-level permissions).

func IsTeamAdminRole

func IsTeamAdminRole(role string) bool

isTeamAdminRole returns true if the given DB-level role string represents a team admin.

func IsValidOrgRole

func IsValidOrgRole(role string) bool

isValidOrgRole returns true if the given string is a valid org member role.

func IsValidTeamRole

func IsValidTeamRole(role string) bool

isValidTeamRole returns true if the given string is a valid team member role.

Types

type InviteData

type InviteData struct {
	InviterName string // Name of the person who sent the invite
	OrgName     string // Organization name
	TeamName    string // Team name (optional)
	Role        string // Role the invitee will have
	AcceptURL   string // URL to accept the invite
	ExpiresIn   string // When the invite expires
}

InviteData holds data for invite email template.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL