Documentation
¶
Index ¶
Constants ¶
const ( RoleAdmin = "admin" RoleMember = "member" RoleOwner = "owner" )
Base role values — the actual strings stored in the database.
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.
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.
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 ¶
isOrgAdminRole returns true if the given DB-level role string represents an org admin or owner (both have admin-level permissions).
func IsTeamAdminRole ¶
isTeamAdminRole returns true if the given DB-level role string represents a team admin.
func IsValidOrgRole ¶
isValidOrgRole returns true if the given string is a valid org member role.
func IsValidTeamRole ¶
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.