From 01985bc5b261b0984a221ddcc3fc246544323b8a Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Mon, 20 Dec 2021 17:02:54 -0300 Subject: [PATCH] Chore: Remove the `mobile-download-file` permission (#23996) * Add migration to remove the mobile-download-file permission * Remove permission from upsertPermissions --- app/authorization/server/functions/upsertPermissions.ts | 1 - packages/rocketchat-i18n/i18n/ca.i18n.json | 1 - packages/rocketchat-i18n/i18n/en.i18n.json | 1 - packages/rocketchat-i18n/i18n/es.i18n.json | 1 - packages/rocketchat-i18n/i18n/fr.i18n.json | 1 - packages/rocketchat-i18n/i18n/nl.i18n.json | 1 - packages/rocketchat-i18n/i18n/pt-BR.i18n.json | 1 - server/startup/migrations/index.ts | 1 + server/startup/migrations/v250.ts | 9 +++++++++ 9 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 server/startup/migrations/v250.ts diff --git a/app/authorization/server/functions/upsertPermissions.ts b/app/authorization/server/functions/upsertPermissions.ts index 6c41b1b11af..03a4d19e846 100644 --- a/app/authorization/server/functions/upsertPermissions.ts +++ b/app/authorization/server/functions/upsertPermissions.ts @@ -151,7 +151,6 @@ export const upsertPermissions = async (): Promise => { { _id: 'pin-message', roles: ['owner', 'moderator', 'admin'] }, { _id: 'snippet-message', roles: ['owner', 'moderator', 'admin'] }, { _id: 'mobile-upload-file', roles: ['user', 'admin'] }, - { _id: 'mobile-download-file', roles: ['user', 'admin'] }, ]; diff --git a/packages/rocketchat-i18n/i18n/ca.i18n.json b/packages/rocketchat-i18n/i18n/ca.i18n.json index a1360d4734c..3ed64304c7d 100644 --- a/packages/rocketchat-i18n/i18n/ca.i18n.json +++ b/packages/rocketchat-i18n/i18n/ca.i18n.json @@ -2994,7 +2994,6 @@ "Mobex_sms_gateway_restful_address_desc": "IP o Host del seu Mobex REST API. Per exemple, `http://192.168.1.1:8080` o `https://www.example.com:8080`", "Mobex_sms_gateway_username": "Nom d'usuari", "Mobile": "Mòbil", - "mobile-download-file": "Permetre la descàrrega de fitxers en dispositius mòbils", "mobile-upload-file": "Permetre la càrrega de fitxers en dispositius mòbils", "Mobile_Push_Notifications_Default_Alert": "Alerta per defecte notificacions mòbil", "Monday": "dilluns", diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 55d0537667e..133c63c19e8 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -3000,7 +3000,6 @@ "Mobex_sms_gateway_restful_address_desc": "IP or Host of your Mobex REST API. E.g. `http://192.168.1.1:8080` or `https://www.example.com:8080`", "Mobex_sms_gateway_username": "Username", "Mobile": "Mobile", - "mobile-download-file": "Allow file download on mobile devices", "mobile-upload-file": "Allow file upload on mobile devices", "Mobile_Push_Notifications_Default_Alert": "Push Notifications Default Alert", "Monday": "Monday", diff --git a/packages/rocketchat-i18n/i18n/es.i18n.json b/packages/rocketchat-i18n/i18n/es.i18n.json index 478a7cf7ae3..284f2171854 100644 --- a/packages/rocketchat-i18n/i18n/es.i18n.json +++ b/packages/rocketchat-i18n/i18n/es.i18n.json @@ -2993,7 +2993,6 @@ "Mobex_sms_gateway_restful_address_desc": "IP o Host de su Mobex REST API. Por ejemplo, `http://192.168.1.1:8080` o `https://www.example.com:8080`", "Mobex_sms_gateway_username": "Nombre de usuario", "Mobile": "Móvil", - "mobile-download-file": "Permitir la descarga de archivos en dispositivos móviles", "mobile-upload-file": "Permitir la carga de archivos en dispositivos móviles", "Mobile_Push_Notifications_Default_Alert": "Alerta predeterminada de notificaciones móviles", "Monday": "Lunes", diff --git a/packages/rocketchat-i18n/i18n/fr.i18n.json b/packages/rocketchat-i18n/i18n/fr.i18n.json index 6a7adf5c725..3d5ca1f700e 100644 --- a/packages/rocketchat-i18n/i18n/fr.i18n.json +++ b/packages/rocketchat-i18n/i18n/fr.i18n.json @@ -3000,7 +3000,6 @@ "Mobex_sms_gateway_restful_address_desc": "IP ou hôte de votre REST API Mobex, par exemple `http://192.168.1.1:8080` ou `https://www.example.com:8080`", "Mobex_sms_gateway_username": "Nom d'utilisateur", "Mobile": "Mobile", - "mobile-download-file": "Autoriser le téléchargement de fichiers sur les appareils mobiles", "mobile-upload-file": "Autoriser l'envoi de fichiers sur les appareils mobiles", "Mobile_Push_Notifications_Default_Alert": "Alerte par défaut des notifications push", "Monday": "Lundi", diff --git a/packages/rocketchat-i18n/i18n/nl.i18n.json b/packages/rocketchat-i18n/i18n/nl.i18n.json index 5326b7a562e..38a2329f660 100644 --- a/packages/rocketchat-i18n/i18n/nl.i18n.json +++ b/packages/rocketchat-i18n/i18n/nl.i18n.json @@ -3000,7 +3000,6 @@ "Mobex_sms_gateway_restful_address_desc": "IP of Host van uw Mobex REST API, bijv. `http://192.168.1.1:8080` of `https://www.example.com:8080`", "Mobex_sms_gateway_username": "Gebruikersnaam", "Mobile": "Mobiel", - "mobile-download-file": "Downloaden van bestanden op mobiele apparaten toestaan", "mobile-upload-file": "Uploaden van bestanden op mobiele apparaten toestaan", "Mobile_Push_Notifications_Default_Alert": "Standaardwaarschuwing pushmeldingen", "Monday": "Maandag", diff --git a/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index fa515b20569..d9ae9bec524 100644 --- a/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -2999,7 +2999,6 @@ "Mobex_sms_gateway_restful_address_desc": "IP ou Host da API REST Mobex. Por exemplo, `http://192.168.1.1:8080` ou `https://www.example.com:8080`", "Mobex_sms_gateway_username": "Nome de Usuário", "Mobile": "Móvel", - "mobile-download-file": "Permitir download em dispositivos móveis", "mobile-upload-file": "Permitir upload em dispositivos móveis", "Mobile_Push_Notifications_Default_Alert": "Alertas Padrão de Notificações Push", "Monday": "Segunda-feira", diff --git a/server/startup/migrations/index.ts b/server/startup/migrations/index.ts index c3b3ff9fca6..75af2dc57df 100644 --- a/server/startup/migrations/index.ts +++ b/server/startup/migrations/index.ts @@ -73,4 +73,5 @@ import './v246'; import './v247'; import './v248'; import './v249'; +import './v250'; import './xrun'; diff --git a/server/startup/migrations/v250.ts b/server/startup/migrations/v250.ts new file mode 100644 index 00000000000..c1aa413d7e3 --- /dev/null +++ b/server/startup/migrations/v250.ts @@ -0,0 +1,9 @@ +import { addMigration } from '../../lib/migrations'; +import { Permissions } from '../../../app/models/server/raw'; + +addMigration({ + version: 250, + up() { + Permissions.removeById('mobile-download-file'); + }, +});