diff --git a/db/migrate/20200923092140_issue3195_inconsistent_granular_agent_permissions_chat.rb b/db/migrate/20200923092140_issue3195_inconsistent_granular_agent_permissions_chat.rb new file mode 100644 index 000000000..caa3aa4c8 --- /dev/null +++ b/db/migrate/20200923092140_issue3195_inconsistent_granular_agent_permissions_chat.rb @@ -0,0 +1,16 @@ +class Issue3195InconsistentGranularAgentPermissionsChat < ActiveRecord::Migration[5.2] + def change + # return if it's a new setup + return if !Setting.exists?(name: 'system_init_done') + + Permission.create_or_update( + name: 'chat', + note: 'Access to %s', + preferences: { + translations: ['Chat'], + disabled: true, + }, + ) + + end +end diff --git a/db/seeds/permissions.rb b/db/seeds/permissions.rb index 6c2662ac5..d8d6c58b3 100644 --- a/db/seeds/permissions.rb +++ b/db/seeds/permissions.rb @@ -348,7 +348,8 @@ Permission.create_if_not_exists( name: 'chat', note: 'Access to %s', preferences: { - translations: ['Chat'] + translations: ['Chat'], + disabled: true, }, ) Permission.create_if_not_exists(