123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- Permission.create_if_not_exists(
- name: 'admin',
- note: 'Admin Interface',
- preferences: {},
- )
- Permission.create_if_not_exists(
- name: 'admin.user',
- note: 'Manage %s',
- preferences: {
- translations: ['Users']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.group',
- note: 'Manage %s',
- preferences: {
- translations: ['Groups']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.role',
- note: 'Manage %s',
- preferences: {
- translations: ['Roles']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.organization',
- note: 'Manage %s',
- preferences: {
- translations: ['Organizations']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.overview',
- note: 'Manage %s',
- preferences: {
- translations: ['Overviews']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.text_module',
- note: 'Manage %s',
- preferences: {
- 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',
- preferences: {
- translations: ['Macros']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.tag',
- note: 'Manage %s',
- preferences: {
- translations: ['Tags']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.calendar',
- note: 'Manage %s',
- preferences: {
- translations: ['Calendar']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.sla',
- note: 'Manage %s',
- preferences: {
- translations: ['SLA']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.scheduler',
- note: 'Manage %s',
- preferences: {
- translations: ['Scheduler']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.report_profile',
- note: 'Manage %s',
- preferences: {
- translations: ['Report Profiles']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.channel_web',
- note: 'Manage %s',
- preferences: {
- translations: ['Channel - Web']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.channel_formular',
- note: 'Manage %s',
- preferences: {
- translations: ['Channel - Formular']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.channel_email',
- note: 'Manage %s',
- preferences: {
- translations: ['Channel - Email']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.channel_twitter',
- note: 'Manage %s',
- preferences: {
- translations: ['Channel - Twitter']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.channel_facebook',
- note: 'Manage %s',
- preferences: {
- translations: ['Channel - Facebook']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.channel_telegram',
- note: 'Manage %s',
- preferences: {
- translations: ['Channel - Telegram']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.channel_sms',
- note: 'Manage %s',
- preferences: {
- translations: ['Channel - SMS']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.channel_chat',
- note: 'Manage %s',
- preferences: {
- translations: ['Channel - Chat']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.branding',
- note: 'Manage %s',
- preferences: {
- translations: ['Branding']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.setting_system',
- note: 'Manage %s Settings',
- preferences: {
- translations: ['System']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.security',
- note: 'Manage %s Settings',
- preferences: {
- translations: ['Security']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.ticket',
- note: 'Manage %s Settings',
- preferences: {
- translations: ['Ticket']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.package',
- note: 'Manage %s',
- preferences: {
- translations: ['Packages']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.integration',
- note: 'Manage %s',
- preferences: {
- translations: ['Integrations']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.api',
- note: 'Manage %s',
- preferences: {
- translations: ['API']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.object',
- note: 'Manage %s',
- preferences: {
- translations: ['Objects']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.translation',
- note: 'Manage %s',
- preferences: {
- translations: ['Translations']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.monitoring',
- note: 'Manage %s',
- preferences: {
- translations: ['Monitoring']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.maintenance',
- note: 'Manage %s',
- preferences: {
- translations: ['Maintenance']
- },
- )
- Permission.create_if_not_exists(
- name: 'admin.session',
- note: 'Manage %s',
- preferences: {
- translations: ['Sessions']
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences',
- note: 'User Preferences',
- preferences: {},
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.password',
- note: 'Change %s',
- preferences: {
- translations: ['Password']
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.notifications',
- note: 'Manage %s',
- preferences: {
- translations: ['Notifications'],
- required: ['ticket.agent'],
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.access_token',
- note: 'Manage %s',
- preferences: {
- translations: ['Token Access']
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.language',
- note: 'Change %s',
- preferences: {
- translations: ['Language']
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.linked_accounts',
- note: 'Manage %s',
- preferences: {
- translations: ['Linked Accounts']
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.device',
- note: 'Manage %s',
- preferences: {
- translations: ['Devices']
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.avatar',
- note: 'Manage %s',
- preferences: {
- translations: ['Avatar']
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.calendar',
- note: 'Access to %s',
- preferences: {
- translations: ['Calendars'],
- required: ['ticket.agent'],
- },
- )
- Permission.create_if_not_exists(
- name: 'user_preferences.out_of_office',
- note: 'Change %s',
- preferences: {
- translations: ['Out of Office'],
- required: ['ticket.agent'],
- },
- )
- Permission.create_if_not_exists(
- name: 'report',
- note: 'Report Interface',
- preferences: {},
- )
- Permission.create_if_not_exists(
- name: 'ticket',
- note: 'Ticket Interface',
- preferences: {
- disabled: true
- },
- )
- Permission.create_if_not_exists(
- name: 'ticket.agent',
- note: 'Access to Agent Tickets based on Group Access',
- preferences: {
- not: ['ticket.customer'],
- plugin: ['groups']
- },
- )
- Permission.create_if_not_exists(
- name: 'ticket.customer',
- note: 'Access to Customer Tickets based on current_user and organization',
- preferences: {
- not: ['ticket.agent'],
- },
- )
- Permission.create_if_not_exists(
- name: 'chat',
- note: 'Access to %s',
- preferences: {
- translations: ['Chat']
- },
- )
- Permission.create_if_not_exists(
- name: 'chat.agent',
- note: 'Access to %s',
- preferences: {
- translations: ['Chat'],
- not: ['chat.customer'],
- },
- )
- Permission.create_if_not_exists(
- name: 'cti',
- note: 'CTI',
- preferences: {
- disabled: true
- },
- )
- Permission.create_if_not_exists(
- name: 'cti.agent',
- note: 'Access to %s',
- preferences: {
- translations: ['CTI'],
- not: ['cti.customer'],
- },
- )
- admin = Role.find_by(name: 'Admin')
- admin.permission_grant('user_preferences')
- admin.permission_grant('admin')
- admin.permission_grant('report')
- agent = Role.find_by(name: 'Agent')
- agent.permission_grant('user_preferences')
- agent.permission_grant('ticket.agent')
- agent.permission_grant('chat.agent')
- agent.permission_grant('cti.agent')
- customer = Role.find_by(name: 'Customer')
- customer.permission_grant('user_preferences.password')
- customer.permission_grant('user_preferences.language')
- customer.permission_grant('user_preferences.linked_accounts')
- customer.permission_grant('user_preferences.avatar')
- customer.permission_grant('ticket.customer')
|