UserAccessLevel
public enum UserAccessLevel : String, Codable, Sendableextension UserAccessLevel: ComparableAll API endpoints are protected by a minimum user access level.
This enum structure MUST match the values in CreateCustomEnums in SchemaCreation.swift
as this enum is part of the database schema. This enum is also sent out in several Data Transfer Object types.
Think very carefully about modifying these values.
- 
                  
                  A user account that has not yet been activated. [read-only, limited] DeclarationSwift case unverified
- 
                  
                  A user account that has been banned. [cannot log in] DeclarationSwift case banned
- 
                  
                  A .verifieduser account that has triggered Moderator review. [read-only]DeclarationSwift case quarantined
- 
                  
                  A user account that has been activated for full read-write access. DeclarationSwift case verified
- 
                  
                  A special class of account for registered API clients. [see ClientController]DeclarationSwift case client
- 
                  
                  An account whose owner is part of the Moderator Team. DeclarationSwift case moderator
- 
                  
                  Twitarr devs should have their accounts elevated to this level to help handle seamail to ‘twitarrteam’ DeclarationSwift case twitarrteam
- 
                  
                  An account officially associated with Management, has access to all .moderatorand a subset of.adminfunctions (the non-destructive ones). Can ban users.DeclarationSwift case tho
- 
                  
                  An Administrator account, unrestricted access. DeclarationSwift case admin
- 
                  
                  DeclarationSwift static func fromRawString(_ str: String) -> `Self`?
- 
                  
                  DeclarationSwift func visibleName() -> String
- 
                  
                  Ensures that the access level of self grants at least the access level given in level. That is, UserAccessLevel.admin.hasAccess(.verified) returns true, while moderator.hasAccess(.admin) returns false. Although this currently uses > to test, the method could be expanded to non-hierarchy access types–and we may need to, asClients can make calls thatModerators cannot, and vice versa.DeclarationSwift func hasAccess(_ level: UserAccessLevel) -> Bool
- 
                  
                  Returns TRUE iff this user is allowed to post their own content and edit or delete content they created.. DeclarationSwift func canCreateContent() -> Bool
- 
                  
                  Returns TRUE if this user is allowed to moderate others’ content. This includes editing text, removing images, and deleting posts. This capability does not include the ability to moderate users themselves. DeclarationSwift func canEditOthersContent() -> Bool
- 
                  
                  Returns TRUE if this user can change the access level of other users. The access level of Client users cannot be changed, and only adminlevel users can set other users’ access level to equal their own. For examplemoderatorusers can change user levels FROM any of [unverified, banned, quarantined, verified] TO any of [unverified, banned, quarantined, verified].DeclarationSwift func canModerateUsers() -> Bool
- 
                  
                  DeclarationSwift public static func < (lhs: UserAccessLevel, rhs: UserAccessLevel) -> Bool
 View on GitHub
            View on GitHub
           UserAccessLevel Enumeration Reference
      UserAccessLevel Enumeration Reference