|
|
|
(defpackage #:user
|
|
|
|
(:use #:cl
|
|
|
|
#:ritherdon-archive.db
|
|
|
|
#:mito
|
|
|
|
#:mito-auth
|
|
|
|
#:app-constants)
|
|
|
|
(:export #:user))
|
|
|
|
(in-package #:user)
|
|
|
|
|
|
|
|
(defclass user (has-secure-password)
|
|
|
|
((username
|
|
|
|
:documentation "The name the user uses to log into the website."
|
|
|
|
:col-type :text
|
|
|
|
:initarg :username
|
|
|
|
:accessor username-of)
|
|
|
|
|
|
|
|
(display-name
|
|
|
|
:documentation "The name used in the website GUI (the pretty name)."
|
|
|
|
:col-type (or :text :null)
|
|
|
|
:initarg :display-name
|
|
|
|
:accessor display-name-of)
|
|
|
|
|
|
|
|
(administrator
|
|
|
|
:documentation "States if user has admin. priveledges. At the time
|
|
|
|
of writing (11/09/2022), SQLite is the current database and it
|
|
|
|
does not have a Boolean datatype so '0' represents 'false' and '1'
|
|
|
|
represents 'true'. You will not come across '0' or '1' in the code
|
|
|
|
because of how mito maps the code to the database. But, you will
|
|
|
|
see it in the database if you view it directly."
|
|
|
|
:col-type :integer
|
|
|
|
:initarg :administrator
|
|
|
|
:initform +false+ ; SQLite: 0 -> false 1 -> true.
|
|
|
|
:accessor is-administrator-p))
|
|
|
|
|
|
|
|
(:documentation "The model used to describe the `USER' table in the database")
|
|
|
|
(:metaclass mito:dao-table-class))
|