Fix uploads for non-admin users

This commit is contained in:
2025-05-17 10:21:37 +08:00
parent 1c79b6a0a3
commit c1eb356a15
3 changed files with 6 additions and 2 deletions

View File

@@ -43,6 +43,10 @@ class App {
isLoggedIn() {
return this.user != null && this.token != null;
}
canUpload() {
return this.isLoggedIn() && (this.user?.can_upload || this.isAdmin());
}
}
export const app = new App();