Files
shcool/college/security/groups.xml
T
2026-08-14 17:17:01 +08:00

38 lines
1.9 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<odoo>
<record id="module_category_education" model="ir.module.category">
<field name="name">教学管理</field>
<field name="sequence">20</field>
</record>
<record id="group_teacher" model="res.groups">
<field name="name">老师</field>
<field name="category_id" ref="module_category_education"/>
<field name="comment">可创建/管理课程、布置与批改作业、查看全部学习进展。</field>
<!-- 让老师拥有「访问权限」级权限(隐含 base.group_erp_manager)。
模块安装的 Python 层 is_admin() 检查 base.group_erp_manager,
因此老师可安装/升级/卸载模块;但老师不是 base.group_system,
所以看不到「设置」菜单。 -->
<field name="implied_ids" eval="[(4, ref('base.group_erp_manager'))]"/>
</record>
<record id="group_student" model="res.groups">
<field name="name">学生</field>
<field name="category_id" ref="module_category_education"/>
<field name="comment">可查看自己选课的课程、提交作业、查看自己的学习进展,不能创建课程。</field>
<!-- 学生仅内部用户,可登录但无模块管理权限 -->
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
</record>
<!-- 学生只能访问自己的习题作答 -->
<record id="rule_exercise_answer_student_own" model="ir.rule">
<field name="name">习题作答:学生仅能访问自己的回答</field>
<field name="model_id" ref="model_yuthon_school_course_chapter_exercise_answer"/>
<field name="groups" eval="[(4, ref('college.group_student'))]"/>
<field name="domain_force">[('user_id', '=', user.id)]</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="False"/>
</record>
</odoo>