enh: file upload user permission

This commit is contained in:
Timothy Jaeryang Baek committed 2024-11-16 21:41:34 -08:00
1 parent cf2dcf1dc3
commit f5df0625e3
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -92,7 +92,7 @@
};
const uploadFileHandler = async (file) => {
if (!($user?.permissions?.chat?.file_upload ?? true)) {
if ($user?.role !== 'admin' && !($_user?.permissions?.chat?.file_upload ?? true)) {
toast.error($i18n.t('You do not have permission to upload files.'));
return null;
}