-
Declaration
Swift
case TwitarrTeam -
Declaration
Swift
case moderator -
Declaration
Swift
case admin -
Declaration
Swift
case THO -
Declaration
Swift
case CommunitySupport -
Usernames that ordinary users can’t register or rename to, case-insensitively. The other privileged names are protected by the username uniqueness check, but
CommunitySupportis created by a migration that may run on a database where somebody has already taken the name; validation keeps them from taking it after the fact.Declaration
Swift
static func isReservedUsername(_ username: String) -> Bool -
True if the username belongs to a shared-mailbox phantom account (see
PrivilegedMailbox.all). Moderator and TwitarrTeam are protected from things like being blocked by their access level, but the CommunitySupport account is only.verified–code that exempts accounts based onaccessLevel >= .moderatormust also check this, or users could block the team’s shared mailbox and lose its replies.Declaration
Swift
static func isSharedMailboxAccount(_ username: String) -> Bool -
Whether
namenames this account, ignoring case: the check for?foruser=values,postAsvalues, and@mentionnames (without the “@”).Declaration
Swift
func matches(_ name: String) -> Bool -
The cached phantom account for this user, or nil if the migration that creates it hasn’t run on this instance.
Declaration
Swift
func cachedUser(on req: Request) -> UserCacheData? -
Declaration
Swift
var queryParam: String { get } -
Service accounts that can authenticate with passwords via HTTP Basic Auth. These are builtin accounts with known passwords (from environment variables). Note: moderator and TwitarrTeam cannot authenticate as their passwords are randomly generated and discarded. Stored as lowercase for case-insensitive matching.
Declaration
Swift
static let serviceAccountsWithPasswords: Set<String> -
Case-insensitive match against
queryParam(lowercasedrawValue).Declaration
Swift
init?(fromQueryParam raw: String) -
Whether callerAccessLevel may author this privileged account for the content type.
Declaration
Swift
func canPostAs(from callerAccessLevel: UserAccessLevel, for content: AuthorableContentType) -> Bool
View on GitHub