본문으로 건너뛰기
Skillpedia
보안48k · #5352

odoo-security-rules

하는 일

이 도구는 Odoo라는 시스템에서 누가 정보를 보고 수정할 수 있는지 설정하도록 돕습니다. 올바른 사람만 올바른 데이터에 접근하도록 규칙을 만듭니다.

사용하는 경우

  • ✓새 사용자 정의 모듈에 접근 권한을 설정할 때.
  • ✓사용자가 자신의 데이터나 회사의 데이터만 보게 하고 싶을 때.
  • ✓‘Access Denied’나 ‘You are not allowed to access’ 오류를 고치는 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-security-rules/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-security-rules/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“일반 사용자가 자신의 판매 주문은 볼 수 있지만 다른 사람의 주문은 볼 수 없도록 접근을 설정해야 합니다.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

접근 권한이 어떻게 작동해야 하는지 설명합니다. 도구는 Odoo가 이 보안 규칙을 이해하고 적용하도록 필요한 코드를 생성합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Odoo Security Rules

Overview

Security in Odoo is managed at two levels: model-level access (who can read/write which models) and record-level rules (which records a user can see). This skill helps you write correct ir.model.access.csv entries and ir.rule domain-based record rules.

When to Use This Skill

  • Setting up access rights for a new custom module.
  • Restricting records so users only see their own data or their company's data.
  • Debugging "Access Denied" or "You are not allowed to access" errors.
  • Implementing multi-company record visibility rules.

How It Works

  1. Activate: Mention @odoo-security-rules and describe the access scenario.
  2. Generate: Get correct CSV access lines and XML record rules.
  3. Debug: Paste an access error and get a diagnosis with the fix.

Examples

Example 1: ir.model.access.csv

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hospital_patient_user,hospital.patient.user,model_hospital_patient,base.group_user,1,0,0,0
access_hospital_patient_manager,hospital.patient.manager,model_hospital_patient,base.group_erp_manager,1,1,1,1

Note: Use base.group_erp_manager for ERP managers, not base.group_system — that group is reserved for Odoo's technical superusers. Always create a custom group for module-specific manager roles:

<record id="group_hospital_manager" model="res.groups">
    <field name="name">Hospital Manager</field>
    <field name="category_id" ref="base.module_category_hidden"/>
</record>

Example 2: Record Rule — Users See Only Their Own Records

<record id="rule_hospital_patient_own" model="ir.rule">
    <field name="name">Hospital Patient: Own Records Only</field>
    <field name="model_id" ref="model_hospital_patient"/>
    <field name="domain_force">[('create_uid', '=', user.id)]</field>
    <field name="groups" eval="[(4, ref('base.group_user'))]"/>
    <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>

Important: If you omit <field name="groups">, the rule becomes global and applies to ALL users, including admins. Always assign a group unless you explicitly intend a global restriction.

Example 3: Multi-Company Record Rule

<record id="rule_hospital_patient_company" model="ir.rule">
    <field name="name">Hospital Patient: Multi-Company</field>
    <field name="model_id" ref="model_hospital_patient"/>
    <field name="domain_force">
        ['|', ('company_id', '=', False),
               ('company_id', 'in', company_ids)]
    </field>
    <field name="groups" eval="[(4, ref('base.group_user'))]"/>
</record>

Best Practices

  • ✅ Do: Start with the most restrictive access and open up as needed.
  • ✅ Do: Use company_ids (plural) in multi-company rules — it includes all companies the user belongs to.
  • ✅ Do: Test rules using a non-admin user in debug mode — sudo() bypasses all record rules entirely.
  • ✅ Do: Create dedicated security groups per module rather than reusing core Odoo groups.
  • ❌ Don't: Give perm_unlink = 1 to regular users unless deletion is explicitly required by the business process.
  • ❌ Don't: Leave group_id blank in ir.model.access.csv unless you intend to grant public (unauthenticated) access.
  • ❌ Don't: Use base.group_system for module managers — that grants full technical access including server configurations.

Limitations

  • Does not cover field-level access control (ir.model.fields read/write restrictions) — those require custom OWL or Python overrides.
  • Portal and public user access rules have additional nuances not fully covered here; test carefully with base.group_portal.
  • Record rules are bypassed by sudo() — any code running in superuser context ignores all ir.rule entries.
  • Does not cover row-level security via PostgreSQL (RLS) — Odoo manages all security at the ORM layer.
자주 묻는 질문

`ir.model.access.csv`란 무엇인가요?

Odoo에서 다양한 유형의 정보(모델)에 대한 일반적인 권한을 정의하는 파일입니다.

‘레코드 규칙(ir.rule)’이란 무엇인가요?

‘내 회사에 속함’ 또는 ‘내가 만듦’ 같은 조건을 기반으로, 사용자가 볼 수 있거나 수정할 수 있는 레코드(데이터 행)를 정의하는 더 구체적인 규칙입니다.

왜 `base.group_system`을 사용하면 안 되나요?

`base.group_system` 그룹은 Odoo의 기술 최고 관리자용이며 민감한 설정을 포함한 전체 접근 권한을 줍니다. 모듈 관리자를 위한 특정 그룹을 만드는 것이 더 좋습니다.

상세 정보

작성자의 원본 설명

Expert in Odoo access control: ir.model.access.csv, record rules (ir.rule), groups, and multi-company security patterns.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5352
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬