UserCacheData
public struct UserCacheData : Authenticatable, SessionAuthenticatable, Sendable
-
Declaration
Swift
let userID: UUID -
Declaration
Swift
let username: String -
Declaration
Swift
let displayName: String? -
Declaration
Swift
let profileUpdateTime: Date -
Declaration
Swift
let userImage: String? -
Declaration
Swift
let blocks: Set<UUID>? -
Declaration
Swift
let mutes: Set<UUID>? -
Declaration
Swift
let mutewords: [String]? -
Declaration
Swift
let token: String? -
Declaration
Swift
let accessLevel: UserAccessLevel -
Declaration
Swift
let userRoles: Set<UserRoleType> -
Declaration
Swift
let tempQuarantineUntil: Date? -
Declaration
Swift
let preferredPronoun: String? -
Declaration
Swift
init(userID: UUID, user: User, blocks: [UUID]?, mutewords: [String]?) -
Declaration
Swift
public var sessionID: String { get } -
Declaration
Swift
func getBlocks() -> Set<UUID> -
Declaration
Swift
func getMutes() -> Set<UUID> -
Declaration
Swift
func makeHeader() -> UserHeader -
getUser(on:Asynchronous) Declaration
Swift
func getUser(on db: Database) async throws -> User -
Ensures that either the receiver can edit/delete other users’ content (that is, they’re a moderator), or that they authored the content they’re trying to modify/delete themselves, and still have rights to edit their own content (that is, they aren’t banned/quarantined).
Declaration
Swift
func guardCanCreateContent(customErrorString: String = "user cannot modify this content") throws -
Ensures that either the receiver can edit/delete other users’ content (that is, they’re a moderator), or that they authored the content they’re trying to modify/delete themselves, and still have rights to edit their own content (that is, they aren’t banned/quarantined).
Declaration
Swift
func guardCanModifyContent<T: Reportable>( _ content: T, customErrorString: String = "user cannot modify this content" ) throws
-
Declaration
Swift
struct BasicAuth : AsyncBasicAuthenticator -
Declaration
Swift
struct TokenAuthenticator : AsyncBearerAuthenticator -
Declaration
Swift
struct SessionAuth : AsyncSessionAuthenticator
View on GitHub