Documentation ¶
Index ¶
- func AddPermission(username string, permission database.PermissionType) (modified bool, err error)
- func DeleteUser(username string) error
- func InitLogger(logger *logrus.Logger)
- func IsStandaloneUserAdmin(username string) (bool, error)
- func Notify(username string, title string, description string, level NotificationLevel) error
- func RemoveAvatar(username string) error
- func RemovePermission(username string, permission database.PermissionType) (modified bool, err error)
- func UploadAvatar(username string, filename string, file multipart.File) error
- func ValidateCredentials(username string, password string) (bool, error)
- type NotificationLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPermission ¶
func AddPermission(username string, permission database.PermissionType) (modified bool, err error)
Adds a permission to an arbitrary user. If the user already has the given permission, a database operation is omitted Does not validate the user's existence
func DeleteUser ¶
Removes a user, also removes everything that depends on the user (permissions, switchPermissions)
func InitLogger ¶
func IsStandaloneUserAdmin ¶
Checks if the user is the only entity with user management permission
func Notify ¶
func Notify(username string, title string, description string, level NotificationLevel) error
func RemoveAvatar ¶
Will remove the current avatar of a user unless it is set to `default`
func RemovePermission ¶
func RemovePermission(username string, permission database.PermissionType) (modified bool, err error)
Removes a permission from an arbitrary user. If the user does not have the given permission, a database operation is omitted Does not validate the user's existence
func UploadAvatar ¶
Accepts a username, filename and multipart file and creates and processes the file
Types ¶
type NotificationLevel ¶
type NotificationLevel uint8
const ( NotificationLevelInfo NotificationLevel = 1 NotificationLevelWarn NotificationLevel = 2 NotificationLevelError NotificationLevel = 3 )
Click to show internal directories.
Click to hide internal directories.