From cd55c44c8fd8f61cdb7cbfb57a588be82c7aa0ab Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Fri, 20 Apr 2018 19:49:13 +0100 Subject: MM-8796: Full implementation of "Schemes" in Store/Model/App layers. (#8357) * Add Scheme model and stub store. * Port ChannelStore to be Scheme aware. * Make almost all the API/APP layer work with ChannelSchemes. Only thing still hacky is UpdateChannelMemberRoles(). * Add basic SchemeStore implementation. * Migrate UpdateChannelMemberRoles properly and fix tests. * Update store tests and mocks so they work. * Include creating default roles in Scheme create store function. * Implement role deletion and start scheme deletion. * Only use non-deleted roles for authorization. * Add GetByScheme method to Team store. * Add GetChannelsByScheme. * Update store mocks. * Implement scheme deletion in the store. * Rename is valid function. * Add offset and limit to queries to fetch teams and channels by scheme. * Fix queries. * Implement scheme awareness in Team store and add a migration. * Tidy up ChannelStore mapping functions and add exhaustive unit tests. * Add all missing i18n. * Proper tests for TeamStore internal functions and fix them. * Make additional TeamMember fields nullable. * Make new ChannelMember fields nullable. * Create new nullable columns without defaults. * Make new fields in large tables nullalble. * Fix empty list of TeamMembers. * Deduplicate SQL queries. * Fix spelling. * Fix review comment. * More review fixes. * More review fixes. --- i18n/en.json | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index ea6314107..61b3e1bf0 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -6690,6 +6690,86 @@ "id": "store.sql_role.get_by_name.app_error", "translation": "Unable to get role" }, + { + "id": "api.channel.update_channel_member_roles.scheme_role.app_error", + "translation": "The provided role is managed by a Scheme and therefore cannot be applied directly to a Channel Member" + }, + { + "id": "api.channel.update_team_member_roles.scheme_role.app_error", + "translation": "The provided role is managed by a Scheme and therefore cannot be applied directly to a Team Member" + }, + { + "id": "store.sql_channel.get_by_scheme.app_error", + "translation": "Unable to get the channels for the provided scheme" + }, + { + "id": "store.sql_team.get_by_scheme.app_error", + "translation": "Unable to get the channels for the provided scheme" + }, + { + "id": "store.sql_role.save.open_transaction.app_error", + "translation": "Failed to open the transaction to save the role" + }, + { + "id": "store.sql_role.save_role.commit_transaction.app_error", + "translation": "Failed to commit the transaction to save the role" + }, + { + "id": "store.sql_role.save.invalid_role.app_error", + "translation": "The provided role is invalid" + }, + { + "id": "store.sql_role.delete.update.app_error", + "translation": "Unable to delete the role" + }, + { + "id": "store.sql_scheme.save.open_transaction.app_error", + "translation": "Failed to open the transaction to save the scheme" + }, + { + "id": "store.sql_scheme.save_scheme.commit_transaction.app_error", + "translation": "Failed to commit the transaction to save the scheme" + }, + { + "id": "store.sql_scheme.save.invalid_scheme.app_error", + "translation": "The provided scheme is invalid" + }, + { + "id": "store.sql_scheme.save.update.app_error", + "translation": "Unable to update the scheme" + }, + { + "id": "store.sql_scheme.save.retrieve_default_scheme_roles.app_error", + "translation": "Unable to retrieve the default scheme roles" + }, + { + "id": "store.sql_scheme.save.insert.app_error", + "translation": "Unable to create the scheme" + }, + { + "id": "store.sql_scheme.get.app_error", + "translation": "Unable to get the scheme" + }, + { + "id": "store.sql_scheme.team_count.app_error", + "translation": "Unable to count the number of teams using this scheme" + }, + { + "id": "store.sql_scheme.delete.scheme_in_use.app_error", + "translation": "Unable to delete the scheme as it in use by 1 or more teams or channels" + }, + { + "id": "store.sql_scheme.channel_count.app_error", + "translation": "Unable to count the number of channels using this scheme" + }, + { + "id": "store.sql_scheme.delete.role_update.app_error", + "translation": "Unable to delete the roles belonging to this scheme" + }, + { + "id": "store.sql_scheme.delete.update.app_error", + "translation": "Unable to delete the scheme" + }, { "id": "store.sql_role.get_by_names.app_error", "translation": "Unable to get roles" -- cgit v1.2.3-1-g7c22 From f4dcb4edf2aafca85c9af631131a77888da24bc7 Mon Sep 17 00:00:00 2001 From: Martin Kraft Date: Wed, 2 May 2018 07:31:14 -0400 Subject: MM-10182 & MM-10183: Adds channel scheme and team scheme API endpoint. (#8680) * MM-10183: Adds channel scheme API endpoint. MM-10182: Adds team scheme API endpoint. MM-10182_3: Switch from scheme_id in path to body. * MM-10182/MM-10183: Changes path from 'schemes' to 'scheme'. * MM-10182: Fix merge error. --- i18n/en.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index bbbeb3302..c0c8ea184 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2506,6 +2506,14 @@ "id": "api.team.update_team.permissions.app_error", "translation": "You do not have the appropriate permissions" }, + { + "id": "api.team.update_team_scheme.license.error", + "translation": "License does not support updating a team's scheme" + }, + { + "id": "api.team.update_team_scheme.scheme_scope.error", + "translation": "Unable to set the scheme to the team because the supplied scheme is not a team scheme." + }, { "id": "api.templates.channel_name.group", "translation": "Group Message" @@ -6694,6 +6702,14 @@ "id": "api.channel.update_team_member_roles.scheme_role.app_error", "translation": "The provided role is managed by a Scheme and therefore cannot be applied directly to a Team Member" }, + { + "id": "api.channel.update_channel_scheme.license.error", + "translation": "License does not support updating a channel's scheme" + }, + { + "id": "api.channel.update_channel_scheme.scheme_scope.error", + "translation": "Unable to set the scheme to the channel because the supplied scheme is not a channel scheme." + }, { "id": "store.sql_channel.get_by_scheme.app_error", "translation": "Unable to get the channels for the provided scheme" -- cgit v1.2.3-1-g7c22 From 60cf74352f13874a7d07c609c03b1c763af19cea Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Thu, 3 May 2018 14:00:26 +0100 Subject: MM-10140: API Implementation for Schemes related Endpoints (#8615) * Implement basic scheme CRUD endpoints. * Get All Schemes (Paged) Endpoint and store plumbing. * Add get teams/channels for schemes. * Fix unit tests. * Review fixes. * More review fixes. --- i18n/en.json | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index 0ff5e5378..c993b0411 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -6654,6 +6654,14 @@ "id": "store.sql_reaction.delete.save.app_error", "translation": "Unable to delete reaction" }, + { + "id": "api.scheme.get_teams_for_scheme.scope.error", + "translation": "Unable to get the teams for scheme because the supplied scheme is not a team scheme." + }, + { + "id": "api.scheme.get_channels_for_scheme.scope.error", + "translation": "Unable to get the channels for scheme because the supplied scheme is not a channel scheme." + }, { "id": "store.sql_reaction.delete_all_with_emoj_name.delete_reactions.app_error", "translation": "Unable to delete reactions with the given emoji name" -- cgit v1.2.3-1-g7c22 From 51bd710ecdca6628461c9fa2679737073e4d5059 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Mon, 14 May 2018 15:59:04 +0100 Subject: MM-9728: Online migration for advanced permissions phase 2 (#8744) * MM-9728: Online migration for advanced permissions phase 2 * Add unit tests for new store functions. * Move migration specific code to own file. * Add migration state function test. * Style fixes. * Add i18n strings. * Fix mocks. * Add TestMain to migrations package tests. * Fix typo. * Fix review comments. * Fix up the "Check if migration is done" check to actually work. --- i18n/en.json | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index 58a950921..0b954d814 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -47,6 +47,54 @@ "id": "September", "translation": "September" }, + { + "id": "migrations.worker.run_advanced_permissions_phase_2_migration.invalid_progress", + "translation": "Migration failed due to invalid progress data." + }, + { + "id": "migrations.worker.run_migration.unknown_key", + "translation": "Cannot run migration job due to unknown migration key." + }, + { + "id": "store.sql_channel.migrate_channel_members.open_transaction.app_error", + "translation": "Failed to open the database transaction" + }, + { + "id": "store.sql_channel.migrate_channel_members.select.app_error", + "translation": "Failed to select the batch of channel members" + }, + { + "id": "store.sql_channel.migrate_channel_members.rollback_transaction.app_error", + "translation": "Failed to roll back the database transaction" + }, + { + "id": "store.sql_channel.migrate_channel_members.update.app_error", + "translation": "Failed to update the channel member" + }, + { + "id": "store.sql_channel.migrate_channel_members.commit_transaction.app_error", + "translation": "Failed to commit the database transaction" + }, + { + "id": "store.sql_team.migrate_team_members.open_transaction.app_error", + "translation": "Failed to open the database transaction" + }, + { + "id": "store.sql_team.migrate_team_members.select.app_error", + "translation": " Failed to select the batch of team members" + }, + { + "id": "store.sql_team.migrate_team_members.rollback_transaction.app_error", + "translation": "Failed to roll back the database transaction" + }, + { + "id": "store.sql_team.migrate_team_members.update.app_error", + "translation": "Failed to update the team member" + }, + { + "id": "store.sql_team.migrate_team_members.commit_transaction.app_error", + "translation": "Failed to commit the database transaction" + }, { "id": "api.admin.add_certificate.no_file.app_error", "translation": "No file under 'certificate' in request." -- cgit v1.2.3-1-g7c22 From c2ab85e0a36af24ee804c1d140cfe216022a4e45 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Thu, 17 May 2018 12:48:18 +0100 Subject: MM-10591: Well known error for all scheme endpoints pre-migration. (#8812) --- i18n/en.json | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index b9b744608..68f6bad59 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -243,6 +243,10 @@ "id": "api.channel.can_manage_channel.private_restricted_system_admin.app_error", "translation": "Private Channel management and creation is restricted to System Administrators." }, + { + "id": "app.schemes.is_phase_2_migration_completed.not_completed.app_error", + "translation": "This API endpoint is not accessible as required migrations have not yet completed." + }, { "id": "api.channel.can_manage_channel.private_restricted_team_admin.app_error", "translation": "Private Channel management and creation is restricted to Team and System Administrators." -- cgit v1.2.3-1-g7c22 From 319d61123a0418ea9caa9510b8ad1e9a302c7b93 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Thu, 17 May 2018 12:48:31 +0100 Subject: MM-10615: Reset teams/channels to default scheme on delete scheme. (#8811) --- i18n/en.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index 68f6bad59..5dc05eba7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -6851,16 +6851,16 @@ "translation": "Unable to get the scheme" }, { - "id": "store.sql_scheme.team_count.app_error", - "translation": "Unable to count the number of teams using this scheme" + "id": "store.sql_scheme.reset_teams.app_error", + "translation": "Unable to reset all teams using this scheme to the default scheme" }, { "id": "store.sql_scheme.delete.scheme_in_use.app_error", "translation": "Unable to delete the scheme as it in use by 1 or more teams or channels" }, { - "id": "store.sql_scheme.channel_count.app_error", - "translation": "Unable to count the number of channels using this scheme" + "id": "store.sql_scheme.reset_channels.app_error", + "translation": "Unable to reset all channels using this scheme to the default scheme" }, { "id": "store.sql_scheme.delete.role_update.app_error", -- cgit v1.2.3-1-g7c22 From a09dc68e1d99394f5d636284e0580dd17b2773b3 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Thu, 17 May 2018 16:28:14 +0100 Subject: MM-10235: Make permissions reset CLI shcemes-aware. (#8773) * MM-10235: Make permissions reset CLI shcemes-aware. * Add i18n strings. --- i18n/en.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index 5dc05eba7..8d2c90db0 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -275,6 +275,18 @@ "id": "api.channel.convert_channel_to_private.private_channel_error", "translation": "The channel requested to convert is already a private channel." }, + { + "id": "store.sql_channel.reset_all_channel_schemes.app_error", + "translation": "We could not reset the channel schemes" + }, + { + "id": "store.sql_scheme.permanent_delete_all.app_error", + "translation": "We could not permanently delete the schemes" + }, + { + "id": "store.sql_team.reset_all_team_schemes.app_error", + "translation": "We could not reset the team schemes" + }, { "id": "api.channel.create_channel.direct_channel.app_error", "translation": "Must use createDirectChannel API service for direct message channel creation" -- cgit v1.2.3-1-g7c22 From e88fe4bb1dea4918284ee3c6e5aee5a8497ff2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 29 May 2018 16:58:12 +0200 Subject: MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions (#8860) * MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions * MM-8853: Removing unnecesary emoji enterprise feature * Create emojis migration * Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS always to system admins * Simplifing permissions checks * Revert "Simplifing permissions checks" This reverts commit e2cafc1905fc9e20125dd9a1552d2d0c7340ae59. --- i18n/en.json | 4 ---- 1 file changed, 4 deletions(-) (limited to 'i18n') diff --git a/i18n/en.json b/i18n/en.json index d631e7e1d..0fc9a733f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1336,10 +1336,6 @@ "id": "api.emoji.delete.delete_reactions.app_error", "translation": "Unable to delete reactions when deleting emoji with emoji name %v" }, - { - "id": "api.emoji.delete.permissions.app_error", - "translation": "Invalid permissions to delete emoji." - }, { "id": "api.emoji.disabled.app_error", "translation": "Custom emoji have been disabled by the system admin." -- cgit v1.2.3-1-g7c22