Security and permissions
Tryton combines model, field, button, and record-rule access. Hiding a menu is not a security policy.
Learning objectives
- Grant privileges through responsibility groups. When finished, verify the result with a test record and document ownership.
- Apply global company rules to multi-company models. When finished, verify the result with a test record and document ownership.
- Protect irreversible or fiscally sensitive buttons. When finished, verify the result with a test record and document ownership.
- Never treat client-provided context flags as authorization. When finished, verify the result with a test record and document ownership.
- Record and review exceptional operations. When finished, verify the result with a test record and document ownership.
Concepts to master
- Grant privileges through responsibility groups.
- Apply global company rules to multi-company models.
- Protect irreversible or fiscally sensitive buttons.
- Never treat client-provided context flags as authorization.
- Record and review exceptional operations.
Guided practice
-
Activity 1. Grant privileges through responsibility groups. Perform it in staging first, record preconditions, and compare expected and actual results.
-
Activity 2. Apply global company rules to multi-company models. Perform it in staging first, record preconditions, and compare expected and actual results.
-
Activity 3. Protect irreversible or fiscally sensitive buttons. Perform it in staging first, record preconditions, and compare expected and actual results.
-
Activity 4. Never treat client-provided context flags as authorization. Perform it in staging first, record preconditions, and compare expected and actual results.
-
Activity 5. Record and review exceptional operations. Perform it in staging first, record preconditions, and compare expected and actual results.
How to verify the result
- Company, user, language, time zone, and date match the scenario.
- Permissions allow only operations assigned to the responsibility.
- Changes are traceable and related documents remain consistent.
- The procedure is repeatable and has a documented correction path.
- A restored backup can reproduce the process without relying on production.
Common mistakes
- Confusing save with confirm, post, pay, or close.
- Testing only as administrator and assuming access rights work.
- Changing states or totals with SQL to bypass validation.
- Upgrading without inventory, restorable backup, and post-upgrade reconciliation.
- Documenting only the happy path while omitting cancellation, correction, and exceptions.
Developer perspective
Identify the models, fields, buttons, domains, and access rules involved. Before extending the process, locate the module that owns the rule, review its tests, and preserve invariants through super(). A correct customization must work across companies, languages, permissions, and states.
Production checklist
- Company, user, language, time zone, and date match the scenario.
- Permissions allow only operations assigned to the responsibility.
- Changes are traceable and related documents remain consistent.
- The procedure is repeatable and has a documented correction path.
- A restored backup can reproduce the process without relying on production.