moo.core.tests.test_security_model_property
Security tests: Property model permission checks.
Covers Property.save / .delete write enforcement, the entrust requirement when changing a property’s owner, and set_protected_attribute() ACL enforcement (the Object.__dict__ shadowing attack).
Functions
The owner can delete a property on their own object. |
|
Property.delete() previously had no permission check. |
|
Wizard (who has entrust on everything) can transfer property ownership. |
|
Property.owner is documented as requiring entrust permission to change, but Property.save() previously only checked write. |
|
A caller with |
|
A non-wizard with read access must not be able to overwrite a property value by obtaining the Property model instance via obj.properties and calling .save(). |
|
Changing a property's value (without changing owner) still only needs write — regression. |
|
A caller with |
|
|
The system object (pk=1) is passed as |
|
set_protected_attribute() only checks for underscore prefixes before calling setattr(). |