moo.core.tests.test_security_model_object
Security tests: Object model permission checks.
Covers Object.delete write enforcement, Object.remove_parent write enforcement, the _original_owner / _original_location entrust-bypass defenses, and the wizard-ORM queryset-mutation guard.
Functions
|
add_parent() still works correctly after remove_parent() was added — regression. |
Mirror of the remove test: |
|
A caller with write but not entrust cannot use Object.save() to transfer ownership to a THIRD PARTY (one who is not the current caller). |
|
A non-wizard with read access must not be able to delete an arbitrary object. |
|
|
Object._original_location is the pre-save location snapshot used by Object.save() to detect location changes and trigger the move permission check plus accept/ enterfunc/exitfunc logic. |
|
Object._original_owner is the pre-save owner snapshot used by Object.save() to detect ownership changes and trigger the entrust permission check. |
remove_parent() goes through the m2m_changed signal handler, which enforces |
|
A caller with |
|
|
Wizard can remove a parent from an object they own. |
When both |
|
A caller with |
|
A caller with |
|
Re-saving an object with no field changes does not require |
|
A caller with |
|
|
WIZARD_ALLOWED_MODULES includes moo.core.models, giving wizard verb code access to Object, Verb, Property, User, Player, and other model classes for debugging purposes. |