aboutsummaryrefslogtreecommitdiffhomepage
path: root/model.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-28 07:15:52 -0500
committerColin Okay <colin@cicadas.surf>2022-10-28 07:15:52 -0500
commit578e2fa0790a7c749e0f597bcdc6b5e4f776dfa2 (patch)
tree1db5347263817aa19723af8a9066457fae11bdbe /model.lisp
parent5b0c8784305b9a2bf34816b264a8d9c6968d0bcc (diff)
Add: collaborator/editor managment on playlists
Diffstat (limited to 'model.lisp')
-rw-r--r--model.lisp9
1 files changed, 9 insertions, 0 deletions
diff --git a/model.lisp b/model.lisp
index a866088..b8f564c 100644
--- a/model.lisp
+++ b/model.lisp
@@ -110,6 +110,15 @@
(hash-string pw (user-pwsalt user)))
user))))
+(defun remove-editor (playlist editor)
+ (with-transaction ()
+ (setf (playlist-editors playlist)
+ (delete editor (playlist-editors playlist)))))
+
+(defun add-editor (playlist editor)
+ (with-transaction ()
+ (pushnew editor (playlist-editors playlist) :test #'eq)))
+
(defun destroy-invite (invite)
(with-transaction ()
(bknr.datastore:delete-object invite)))