From 769fb19064e68bc2ec6ee53b84f55e8372a52567 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 13 Sep 2018 12:28:58 +0200 Subject: [PATCH] Added missing admin.time_accounting permission entry. --- ...0913000002_permission_add_time_accounting.rb | 17 +++++++++++++++++ db/seeds/permissions.rb | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 db/migrate/20180913000002_permission_add_time_accounting.rb diff --git a/db/migrate/20180913000002_permission_add_time_accounting.rb b/db/migrate/20180913000002_permission_add_time_accounting.rb new file mode 100644 index 000000000..5776f63b8 --- /dev/null +++ b/db/migrate/20180913000002_permission_add_time_accounting.rb @@ -0,0 +1,17 @@ +class PermissionAddTimeAccounting < ActiveRecord::Migration[5.1] + def up + + # return if it's a new setup + return if !Setting.find_by(name: 'system_init_done') + + Permission.create_if_not_exists( + name: 'admin.time_accounting', + note: 'Manage %s', + preferences: { + translations: ['Time Accounting'] + }, + ) + + end + +end diff --git a/db/seeds/permissions.rb b/db/seeds/permissions.rb index 78414279e..0c5212e29 100644 --- a/db/seeds/permissions.rb +++ b/db/seeds/permissions.rb @@ -45,6 +45,13 @@ Permission.create_if_not_exists( translations: ['Text Modules'] }, ) +Permission.create_if_not_exists( + name: 'admin.time_accounting', + note: 'Manage %s', + preferences: { + translations: ['Time Accounting'] + }, +) Permission.create_if_not_exists( name: 'admin.macro', note: 'Manage %s',