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',