Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into message-star-to-js
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchoeler committed Apr 27, 2017
2 parents 1ba54db + 1359fff commit e91c9cd
Show file tree
Hide file tree
Showing 73 changed files with 743 additions and 391 deletions.
13 changes: 12 additions & 1 deletion packages/rocketchat-api/server/v1/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ RocketChat.API.v1.addRoute('users.update', { authRequired: true }, {

const userData = _.extend({ _id: this.bodyParams.userId }, this.bodyParams.data);

RocketChat.saveUser(this.userId, userData);
Meteor.runAsUser(this.userId, () => RocketChat.saveUser(this.userId, userData));

if (this.bodyParams.data.customFields) {
RocketChat.saveCustomFields(this.bodyParams.userId, this.bodyParams.data.customFields);
Expand All @@ -263,3 +263,14 @@ RocketChat.API.v1.addRoute('users.update', { authRequired: true }, {
return RocketChat.API.v1.success({ user: RocketChat.models.Users.findOneById(this.bodyParams.userId, { fields: RocketChat.API.v1.defaultFieldsToExclude }) });
}
});

RocketChat.API.v1.addRoute('users.createToken', { authRequired: true }, {
post() {
const user = this.getUserFromParams();
let data;
Meteor.runAsUser(this.userId, () => {
data = Meteor.call('createToken', user._id);
});
return data ? RocketChat.API.v1.success({data}) : RocketChat.API.v1.unauthorized();
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
RocketChat.authz.roomAccessValidators = [
function(room, user = {}) {
if (room.t === 'c') {
if (!user._id && RocketChat.settings.get('Accounts_AllowAnonymousAccess') === true) {
if (!user._id && RocketChat.settings.get('Accounts_AllowAnonymousRead') === true) {
return true;
}

Expand Down
14 changes: 8 additions & 6 deletions packages/rocketchat-authorization/server/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,21 @@ Meteor.startup(function() {
{ _id: 'set-moderator', roles : ['admin', 'owner'] },
{ _id: 'set-owner', roles : ['admin', 'owner'] },
{ _id: 'unarchive-room', roles : ['admin'] },
{ _id: 'view-c-room', roles : ['admin', 'user', 'bot'] },
{ _id: 'view-c-room', roles : ['admin', 'user', 'bot', 'anonymous'] },
{ _id: 'user-generate-access-token', roles : ['admin'] },
{ _id: 'view-d-room', roles : ['admin', 'user', 'bot'] },
{ _id: 'view-full-other-user-info', roles : ['admin'] },
{ _id: 'view-history', roles : ['admin', 'user'] },
{ _id: 'view-joined-room', roles : ['guest', 'bot'] },
{ _id: 'view-history', roles : ['admin', 'user', 'anonymous'] },
{ _id: 'view-joined-room', roles : ['guest', 'bot', 'anonymous'] },
{ _id: 'view-join-code', roles : ['admin'] },
{ _id: 'view-logs', roles : ['admin'] },
{ _id: 'view-other-user-channels', roles : ['admin'] },
{ _id: 'view-p-room', roles : ['admin', 'user'] },
{ _id: 'view-p-room', roles : ['admin', 'user', 'anonymous'] },
{ _id: 'view-privileged-setting', roles : ['admin'] },
{ _id: 'view-room-administration', roles : ['admin'] },
{ _id: 'view-statistics', roles : ['admin'] },
{ _id: 'view-user-administration', roles : ['admin'] },
{ _id: 'preview-c-room', roles : ['admin', 'user'] }
{ _id: 'preview-c-room', roles : ['admin', 'user', 'anonymous'] }
];

for (const permission of permissions) {
Expand All @@ -74,7 +75,8 @@ Meteor.startup(function() {
{ name: 'owner', scope: 'Subscriptions', description: 'Owner' },
{ name: 'user', scope: 'Users', description: '' },
{ name: 'bot', scope: 'Users', description: '' },
{ name: 'guest', scope: 'Users', description: '' }
{ name: 'guest', scope: 'Users', description: '' },
{ name: 'anonymous', scope: 'Users', description: '' }
];

for (const role of defaultRoles) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions packages/rocketchat-i18n/i18n/bg.i18n.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"#channel": "#канал",
"0_Errors_Only": "0 - Само Грешки",
"1_Errors_and_Information": "1 - Грешки и Информация",
"2_Erros_Information_and_Debug": "2 - Грешки, Информация и Дебъг",
"403": "Забранен",
"@username": "@потребителско име",
"@username_message": "@потребителско име<message>",
Expand All @@ -23,6 +25,7 @@
"Accounts_OAuth_Facebook": "Влизана с Facebook профил",
"Accounts_OAuth_Google": "Влизане с Google профил",
"Accounts_RegistrationForm_Public": "Обществен",
"All_channels": "Всички канали",
"All_messages": "Всички съобщения",
"and": "и",
"Application_Name": "Име на Приложение",
Expand All @@ -38,6 +41,8 @@
"Busy_male": "Зает",
"channel": "канал",
"Channel": "Канал",
"Channels": "Канали",
"Channels_list": "Списък на публични канали",
"Click_here": "Натисни тук",
"close": "затвори",
"Close": "Затвори",
Expand Down Expand Up @@ -84,6 +89,7 @@
"LDAP_Port": "Порт",
"Leave_room": "Излез от стаята",
"line": "линия",
"List_of_Channels": "Списък с Канали",
"Loading...": "Зареждане...",
"Log_Package": "Покажи пакет",
"Login": "Влез",
Expand All @@ -96,6 +102,7 @@
"Message_too_long": "Съобщението е твърде дълго",
"Messages": "Съобщения",
"minutes": "Минути",
"More_channels": "Още канали",
"My_Account": "Моя Профил",
"n_messages": "%s съобщения",
"N_new_messages": "%s нови съобщения",
Expand All @@ -112,6 +119,7 @@
"Online": "На линия",
"Oops!": "Упс",
"Open": "Отвори",
"Password": "Парола",
"People": "Хора",
"Please_add_a_comment": "Добави коментар моля",
"Please_wait": "Моля изчакайте",
Expand Down Expand Up @@ -145,6 +153,8 @@
"Site_Name": "Име на Сайта",
"Skip": "Прескочи",
"Smarsh_MissingEmail_Email": "Липсваща Електрона поща",
"Stats_Total_Channels": "Общо Канали",
"Stats_Total_Messages_Channel": "Общо Съобщения в Канали",
"Test_Desktop_Notifications": "Изпробвай Известия на работния плот",
"Thank_you_exclamation_mark": "Благодаря!",
"The_server_will_restart_in_s_seconds": "Сървъра ще бъде рестартиран след %s секунди",
Expand Down
7 changes: 6 additions & 1 deletion packages/rocketchat-i18n/i18n/ca.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"Accessing_permissions": "L'accés als permisos",
"Account_SID": "Compte SID",
"Accounts": "Comptes",
"Accounts_AllowAnonymousAccess": "Permet accés anònim",
"Accounts_AllowDeleteOwnAccount": "Permetre als usuaris eliminar el seu propi compte",
"Accounts_AllowedDomainsList": "Llista de dominis permesos",
"Accounts_AllowedDomainsList_Description": "Llista dels dominis permesos separada per comes ",
Expand Down Expand Up @@ -416,6 +417,7 @@
"Desktop_Notifications_Enabled": "Les notificacions d'escriptori estan activades",
"Direct_message_someone": "Envia un missatge directe a algú",
"Direct_Messages": "Missatges directes",
"Disable_Notifications": "Desactiva notificacions",
"Disable_two-factor_authentication": "Desactiva l'autenticació de dos factors",
"Display_offline_form": "Mostra el formulari de fora de línia",
"Displays_action_text": "Mostra text de l'acció",
Expand Down Expand Up @@ -644,6 +646,7 @@
"Hide_room": "Oculta sala",
"Hide_Room_Warning": "Segur que voleu ocultar la sala \"%s\"?",
"Hide_roles": "Amaga rols",
"Hide_Unread_Room_Status": "Amaga l'estat de sales no llegides",
"Hide_usernames": "Oculta els noms d'usuari",
"Highlights": "Ressalta",
"Highlights_How_To": "Per ser notificat quan algú esmenta una paraula o frase, afegeix-la aquí. Es poden separar les paraules o frases amb comes. No es distingeix entre majúscules i minúscules.",
Expand Down Expand Up @@ -1082,6 +1085,7 @@
"Nothing_found": "No s'ha trobat res",
"Notification_Duration": "Duració de la notificació",
"Notifications": "Notificacions",
"Notifications_Muted_Description": "Si esculls silenciar-ho tot, no veuràs la sala destacada a la llista quan hi hagi nous missatges, excepte si són mencions. Silenciar les notificacions sobreescriurà les opcions de notificació.",
"Notify_all_in_this_room": "Notifica a tothom d'aquest canal",
"Notify_active_in_this_room": "Notifica als usuaris actius d'aquesta sala",
"Num_Agents": "# d'agents",
Expand Down Expand Up @@ -1224,6 +1228,7 @@
"Register": "Crea un compte nou",
"Registration": "Registre",
"Registration_Succeeded": "Registre reeixit",
"Register_or_login_to_send_messages": "Registra't o identifica't per enviar missatges",
"Registration_via_Admin": "Registre via Admin",
"Regular_Expressions": "Expressions regulars",
"Release": "Llançament",
Expand Down Expand Up @@ -1547,7 +1552,7 @@
"Unmute_user": "Dóna veu a l'usuari",
"Unnamed": "Sense nom",
"Unpin_Message": "Desfixa el missatge",
"Unread_Alert": "Alerta de no llegit",
"Unread_Tray_Icon_Alert": "Icona d'alerta de no llegits a la safata",
"Unread_Messages": "Missatges no llegits",
"Unread_Rooms": "Sales no llegides",
"Unread_Rooms_Mode": "Mode de sales no llegides",
Expand Down
15 changes: 14 additions & 1 deletion packages/rocketchat-i18n/i18n/cs.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"Accessing_permissions": "Přístup k oprávnění",
"Account_SID": "SID účtu",
"Accounts": "Účty",
"Accounts_AllowAnonymousAccess": "Povolit anonymní přístup",
"Accounts_AllowDeleteOwnAccount": "Povolit uživatelům odstranit vlastní účet",
"Accounts_AllowedDomainsList": "Seznam povolených domén",
"Accounts_AllowedDomainsList_Description": "Čárkami oddělený seznam povolených domén",
Expand Down Expand Up @@ -62,6 +63,10 @@
"Accounts_OAuth_Custom_Token_Path": "Cesta k tokenu",
"Accounts_OAuth_Custom_Token_Sent_Via": "Token odesílány přes",
"Accounts_OAuth_Custom_Username_Field": "Pole uživatelské jméno",
"Accounts_OAuth_Drupal": "Povolit Drupal přihlášení",
"Accounts_OAuth_Drupal_callback_url": "Drupal oAuth2 URI Přesměrování",
"Accounts_OAuth_Drupal_id": "Drupal oAuth2 ID klienta",
"Accounts_OAuth_Drupal_secret": "Drupal oAuth2 Secret klienta",
"Accounts_OAuth_Facebook": "Facebook Přihlášení",
"Accounts_OAuth_Facebook_callback_url": "Facebook Callback URL",
"Accounts_OAuth_Facebook_id": "Facebook App Id",
Expand Down Expand Up @@ -170,6 +175,8 @@
"API_CORS_Origin": "CORS Origin",
"API_Default_Count": "Výchozí počet",
"API_Default_Count_Description": "Výchozí počet výsledků v REST API pokud není zažádáno konkrétní číslo",
"API_Drupal_URL": "Drupal URL Serveru",
"API_Drupal_URL_Description": "Například: https://domain.com (bez lomítka na konci)",
"API_Embed": "Náhled vložených odkazů",
"API_Embed_Description": "Zda zobrazit náhled stránky když uživatel pošle odkaz",
"API_EmbedCacheExpirationDays": "Počet dní expirace cache embed",
Expand Down Expand Up @@ -410,6 +417,7 @@
"Desktop_Notifications_Enabled": "Oznámení na ploše jsou povolena",
"Direct_message_someone": "Přímá zpráva někomu",
"Direct_Messages": "Přímé zprávy",
"Disable_Notifications": "Zakázat notifikace",
"Disable_two-factor_authentication": "Zakázat dvoufázové ověření",
"Display_offline_form": "Zobrazit offline formulář",
"Displays_action_text": "Zobrazuje text akce",
Expand Down Expand Up @@ -638,6 +646,7 @@
"Hide_room": "Skrýt místnost",
"Hide_Room_Warning": "Jste si jisti, že chcete skrýt místnost \"%s\"?",
"Hide_roles": "Schovat role",
"Hide_Unread_Room_Status": "Schovat stav nepřečtených místností",
"Hide_usernames": "Skrýt uživatelská jména",
"Highlights": "Klíčová slova",
"Highlights_How_To": "Chcete-li být upozorněni, když někdo zmíní slovo nebo frázi, přidejte jej sem. Můžete oddělit slova nebo fráze čárkami. Velikost písmen nehraje roli",
Expand Down Expand Up @@ -730,6 +739,8 @@
"Integration_Retry_Count_Description": "Kolikrát by se integrace měla znova pokusit volat URL pokud byl první pokus neúspěšný?",
"Integration_Retry_Delay": "Čas prodlení opakování",
"Integration_Retry_Delay_Description": "Jaký algoritmus prodlení by se měl použít?<code class=\"inline\">10^x</code>, <code class=\"inline\">2^x</code> nebo <code class=\"inline\">x*2</code>",
"Integration_Run_When_Message_Is_Edited": "Spustit při editaci",
"Integration_Run_When_Message_Is_Edited_Description": "Měla by být integrace spuštěna po editaci zprávy? Pokud volbu vypnete, integrace se bude spouštět pouze pro <strong>nové</strong> zprávy.",
"Integration_Word_Trigger_Placement": "Přepisování slov kdekoliv",
"Integration_Word_Trigger_Placement_Description": "Mělo by se vyvolat pokud je slovo umístěno jinde než na začátku?",
"Integration_updated": "Integrace byla aktualizována",
Expand Down Expand Up @@ -1074,6 +1085,7 @@
"Nothing_found": "Nic nalezeno",
"Notification_Duration": "Délka zobrazení oznámení",
"Notifications": "Oznámení",
"Notifications_Muted_Description": "Pokud ztišíte všechno, neuvidíte zvýrazněné místnosti s novými zprávami, krom zmínek. Ztišení notifikací přetěží nastavení notifikací v jednotlivých místnostech.",
"Notify_all_in_this_room": "Oznámit všem v této místnosti",
"Notify_active_in_this_room": "Notifikovat aktivní uživatele v místnosti",
"Num_Agents": "# Operátorů",
Expand Down Expand Up @@ -1216,6 +1228,7 @@
"Register": "Zaregistrovat nový účet",
"Registration": "Registrace",
"Registration_Succeeded": "Registrace úspěšná",
"Register_or_login_to_send_messages": "Pro odeslání zpráv je třeba se zaregistrovat nebo přihlásit",
"Registration_via_Admin": "Registrace přes Admin",
"Regular_Expressions": "Regulární výrazy",
"Release": "Verze",
Expand Down Expand Up @@ -1539,7 +1552,7 @@
"Unmute_user": "Zrušit ztlumení uživatele",
"Unnamed": "Nepojmenovaný",
"Unpin_Message": "Odepnout Zprávu",
"Unread_Alert": "Nepřečtené upozornění",
"Unread_Tray_Icon_Alert": "Ikona v oznamovací oblasti upozorňuje na nepřečtené zprávy",
"Unread_Messages": "Nepřečtěné zprávy",
"Unread_Rooms": "Nepřečtené místnosti",
"Unread_Rooms_Mode": "Mód Nepřečtených místností",
Expand Down
1 change: 0 additions & 1 deletion packages/rocketchat-i18n/i18n/de-AT.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,6 @@
"Unmute_user": "Benutzern das Chatten erlauben ",
"Unnamed": "Unbenannt",
"Unpin_Message": "Nachicht nicht mehr fixieren",
"Unread_Alert": "Über Ungelesenes benachrichtigen",
"Unread_Rooms": "Ungelesene Räume",
"Unread_Rooms_Mode": "Ungelesene Räume aufgelistet anzeigen ",
"Unstar_Message": "Markierung entfernen",
Expand Down
5 changes: 2 additions & 3 deletions packages/rocketchat-i18n/i18n/de.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@
"Selected_agents": "Ausgewählte Agenten",
"Send": "Senden",
"Send_a_message": "Eine Nachricht schicken",
"Send_a_test_mail_to_my_user": "Eine Test-E-Mail an die Benutzer senden",
"Send_a_test_mail_to_my_user": "Eine Test-E-Mail an mich senden",
"Send_a_test_push_to_my_user": "Eine Test-Push-Nachricht an mich senden",
"Send_confirmation_email": "Bestätigungsmail versenden",
"Send_data_into_RocketChat_in_realtime": "Daten in Rocket.Chat in Echtzeit senden.",
Expand All @@ -1089,7 +1089,7 @@
"Sending": "Senden...",
"Service": "Service",
"Set_as_moderator": "Zum Moderator ernennen",
"Set_as_owner": "zum Besitzer machen",
"Set_as_owner": "Zum Besitzer machen",
"Settings": "Einstellungen",
"Settings_updated": "Die Einstellungen wurden aktualisiert.",
"Share_Location_Title": "Standort teilen?",
Expand Down Expand Up @@ -1233,7 +1233,6 @@
"Unmute_user": "Benutzern das Chatten erlauben ",
"Unnamed": "Unbenannt",
"Unpin_Message": "Nachicht nicht mehr anheften",
"Unread_Alert": "Über Ungelesenes benachrichtigen",
"Unread_Rooms": "Ungelesene Räume",
"Unread_Rooms_Mode": "Ungelesene Räume aufgelistet anzeigen ",
"Unstar_Message": "Markierung entfernen",
Expand Down
13 changes: 8 additions & 5 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Accessing_permissions": "Accessing permissions",
"Account_SID": "Account SID",
"Accounts": "Accounts",
"Accounts_AllowAnonymousAccess": "Allow anonymous access",
"Accounts_AllowAnonymousRead": "Allow anonymous read",
"Accounts_AllowAnonymousWrite": "Allow anonymous write",
"Accounts_AllowDeleteOwnAccount": "Allow users to delete own account",
"Accounts_AllowedDomainsList": "Allowed Domains List",
"Accounts_AllowedDomainsList_Description": "Comma-separated list of allowed domains",
Expand All @@ -35,6 +36,7 @@
"Accounts_BlockedUsernameList": "Blocked Username List",
"Accounts_BlockedUsernameList_Description": "Comma-separated list of blocked usernames (case-insensitive)",
"Accounts_CustomFields_Description": "Should be a valid JSON where keys are the field names containing a dictionary of field settings. Example:<br/><code>{\n\"role\": {\n  \"type\": \"select\",\n  \"defaultValue\": \"student\",\n  \"options\": [\"teacher\", \"student\"],\n  \"required\": true,\n  \"modifyRecordField\": {\n   \"array\": true,\n   \"field\": \"roles\"\n  }\n },\n\"twitter\": {\n  \"type\": \"text\",\n  \"required\": true,\n  \"minLength\": 2,\n  \"maxLength\": 10\n }\n}</code> ",
"Accounts_DefaultUsernamePrefixSuggestion": "Default username prefix suggestion",
"Accounts_denyUnverifiedEmail": "Deny unverified email",
"Accounts_EmailVerification": "Email Verification",
"Accounts_EmailVerification_Description": "Make sure you have correct SMTP settings to use this feature",
Expand Down Expand Up @@ -668,11 +670,11 @@
"Iframe_Integration_receive_enable": "Enable Receive",
"Iframe_Integration_receive_enable_Description": "Allow parent window to send commands to Rocket.Chat.",
"Iframe_Integration_receive_origin": "Receive origins",
"Iframe_Integration_receive_origin_Description": "Only pages with given origin will be able to send commands or `*` for all origins. You can use multiple values separated by `,`. Example `http://localhost,https://localhost`",
"Iframe_Integration_receive_origin_Description": "Origins with protocol prefix, separated by commas, which are allowed to receive commands e.g. 'https://localhost, http://localhost', or * to allow receiving from anywhere.",
"Iframe_Integration_send_enable": "Enable Send",
"Iframe_Integration_send_enable_Description": "Send events to parent window",
"Iframe_Integration_send_target_origin": "Send target origin",
"Iframe_Integration_send_target_origin_Description": "Only pages with given origin will be able to listen to events or `*` for all origins. Example `http://localhost`",
"Iframe_Integration_send_target_origin_Description": "Origin with protocol prefix, which commands are sent to e.g. 'https://localhost', or * to allow sending to anywhere.",
"Importer_Archived": "Archived",
"Importer_CSV_Information": "The CSV importer requires a specific format, please read the documentation for how to structure your zip file:",
"Importer_HipChatEnterprise_Information": "The file uploaded must be a decrypted tar.gz, please read the documentation for further information:",
Expand Down Expand Up @@ -1124,6 +1126,7 @@
"or": "or",
"Open_your_authentication_app_and_enter_the_code": "Open your authentication app and enter the code. You can also use one of your backup codes.",
"Order": "Order",
"Or_talk_as_anonymous": "Or talk as anonymous",
"OS_Arch": "OS Arch",
"OS_Cpus": "OS CPU Count",
"OS_Freemem": "OS Free Memory",
Expand Down Expand Up @@ -1228,7 +1231,6 @@
"Register": "Register a new account",
"Registration": "Registration",
"Registration_Succeeded": "Registration Succeeded",
"Register_or_login_to_send_messages": "Register or login to send messages",
"Registration_via_Admin": "Registration via Admin",
"Regular_Expressions": "Regular Expressions",
"Release": "Release",
Expand Down Expand Up @@ -1363,6 +1365,7 @@
"Showing_archived_results": "<p>Showing <b>%s</b> archived results</p>",
"Showing_online_users": "Showing: <b>__total_showing__</b>, Online: __online__, Total: __total__ users",
"Showing_results": "<p>Showing <b>%s</b> results</p>",
"Sign_in_to_start_talking": "Sign in to start talking",
"since_creation": "since %s",
"Site_Name": "Site Name",
"Site_Url": "Site URL",
Expand Down Expand Up @@ -1716,4 +1719,4 @@
"your_message_optional": "your message (optional)",
"Your_password_is_wrong": "Your password is wrong!",
"Your_push_was_sent_to_s_devices": "Your push was sent to %s devices"
}
}
Loading

0 comments on commit e91c9cd

Please sign in to comment.