moo.core.tests.test_security_model_verb
Security tests: Verb / VerbName / Alias model permission checks.
Covers Verb.save / .delete / .reload, VerbName.save / .delete, Alias.delete, Verb._invoked_object / _invoked_name read+write blocking, and passthrough() caller-context forgery.
Functions
Alias.save() was already permission-checked, but Alias.delete() was not. |
|
passthrough() is passed to verb code as its second positional argument. |
|
passthrough() raises RuntimeError when called on an unbound verb (no _invoked_object/_invoked_name set). |
|
|
The owner can delete a verb on their own object. |
Verb.delete() previously had no permission check. |
|
Verb.reload() previously had no permission check. |
|
|
The owner of an object can still save changes to a verb on it. |
A non-wizard with only read access must not be able to overwrite verb code by getting a Verb model instance and calling .save() directly. |
|
VerbName.delete() previously had no permission check. |
|
VerbName.save() previously had no permission check. |
|
|
Verb._invoked_name is an underscore-prefixed instance attribute. |
|
Verb._invoked_object is underscore-prefixed; get_protected_attribute must block read access from verb code, preventing information disclosure about the dispatch target. |
|
Verb._invoked_object is an underscore-prefixed instance attribute. |