PLT-6924 Added ability to disable file uploads/downloads on old mobile apps (#7117)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
3998659236
Коммит
fb2022fb1c
24
webapp/utils/file_utils.jsx
Обычный файл
24
webapp/utils/file_utils.jsx
Обычный файл
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
import * as UserAgent from 'utils/user_agent';
|
||||
|
||||
export function canUploadFiles() {
|
||||
if (window.mm_config.EnableFileAttachments === 'false') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (UserAgent.isMobileApp() && window.mm_license.IsLicensed === 'true' && window.mm_license.Compliance === 'true') {
|
||||
return window.mm_config.EnableMobileFileUpload !== 'false';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
export function canDownloadFiles() {
|
||||
if (UserAgent.isMobileApp() && window.mm_license.IsLicensed === 'true' && window.mm_license.Compliance === 'true') {
|
||||
return window.mm_config.EnableMobileFileDownload !== 'false';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Ссылка в новой задаче
Block a user