summaryrefslogtreecommitdiff
path: root/addons/im_livechat/security
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/im_livechat/security
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/im_livechat/security')
-rw-r--r--addons/im_livechat/security/im_livechat_channel_security.xml40
-rw-r--r--addons/im_livechat/security/ir.model.access.csv9
2 files changed, 49 insertions, 0 deletions
diff --git a/addons/im_livechat/security/im_livechat_channel_security.xml b/addons/im_livechat/security/im_livechat_channel_security.xml
new file mode 100644
index 00000000..89c1910e
--- /dev/null
+++ b/addons/im_livechat/security/im_livechat_channel_security.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<odoo>
+
+ <record id="module_category_im_livechat" model="ir.module.category">
+ <field name="name">Live Chat</field>
+ <field name="sequence" eval="20" />
+ </record>
+
+ <record id="im_livechat_group_user" model="res.groups">
+ <field name="name">User</field>
+ <field name="category_id" ref="base.module_category_website_live_chat"/>
+ <field name="comment">The user will be able to join support channels.</field>
+ </record>
+
+ <record id="im_livechat_group_manager" model="res.groups">
+ <field name="name">Administrator</field>
+ <field name="comment">The user will be able to delete support channels.</field>
+ <field name="category_id" ref="base.module_category_website_live_chat"/>
+ <field name="implied_ids" eval="[(4, ref('im_livechat.im_livechat_group_user'))]"/>
+ <field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
+ </record>
+
+ <data noupdate="1">
+ <record id="im_livechat_rule_manager_read_all_mail_channel" model="ir.rule">
+ <field name="name">Livechat: Administrator: read all livechat channel</field>
+ <field name="model_id" ref="model_mail_channel"/>
+ <field name="groups" eval="[(4, ref('im_livechat_group_manager'))]"/>
+ <field name="domain_force">[('channel_type', '=', 'livechat')]</field>
+ <field name="perm_read" eval="True"/>
+ <field name="perm_create" eval="False"/>
+ <field name="perm_write" eval="False"/>
+ <field name="perm_unlink" eval="False"/>
+ </record>
+
+
+ <record id="base.default_user" model="res.users">
+ <field name="groups_id" eval="[(4,ref('im_livechat.im_livechat_group_manager'))]"/>
+ </record>
+ </data>
+</odoo>
diff --git a/addons/im_livechat/security/ir.model.access.csv b/addons/im_livechat/security/ir.model.access.csv
new file mode 100644
index 00000000..c8c52517
--- /dev/null
+++ b/addons/im_livechat/security/ir.model.access.csv
@@ -0,0 +1,9 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_livechat_channel,im_livechat.channel,model_im_livechat_channel,,1,0,0,0
+access_livechat_channel_user,im_livechat.channel.user,model_im_livechat_channel,im_livechat_group_user,1,1,1,0
+access_livechat_channel_manager,im_livechat.channel.manager,model_im_livechat_channel,im_livechat_group_manager,1,1,1,1
+access_livechat_support_report_channel,im_livechat.report.channel,model_im_livechat_report_channel,im_livechat_group_manager,1,1,1,1
+access_livechat_support_report_operator,im_livechat.report.operator,model_im_livechat_report_operator,im_livechat_group_manager,1,1,1,1
+access_livechat_channel_rule,im_livechat.channel.rule,model_im_livechat_channel_rule,,1,0,0,0
+access_livechat_channel_rule_user,im_livechat.channel.rule,model_im_livechat_channel_rule,im_livechat_group_user,1,1,1,0
+access_livechat_channel_rule_manager,im_livechat.channel.rule,model_im_livechat_channel_rule,im_livechat_group_manager,1,1,1,1