Skip to content

Commit

Permalink
Document safer_getattr.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Oct 26, 2018
1 parent 514456a commit 4aceff3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/old_README.rst
Expand Up @@ -61,9 +61,12 @@ Specifically:
takes two arguments. The first is the base object to be accessed,
while the second is the attribute name or item index that will be
read. The guard function should return the attribute or subitem,
or raise an exception. RestrictedPython ships with a default implementation
for ``_getattr_`` which prevents from using the format method of
strings as it is considered harmful.
or raise an exception.
RestrictedPython ships with a default implementation
for ``_getattr_`` which prevents the following actions:

* accessing an attribute those name start with an underscore
* accessing the format method of strings as it is considered harmful.

4. ``__import__`` is the normal Python import hook, and should be used
to control access to Python packages and modules.
Expand Down
1 change: 1 addition & 0 deletions docs/usage/policy.rst
Expand Up @@ -33,6 +33,7 @@ Guards

RestrictedPython predefines several guarded access and manipulation methods:

* ``safer_getattr``
* ``guarded_setattr``
* ``guarded_delattr``
* ``guarded_iter_unpack_sequence``
Expand Down

0 comments on commit 4aceff3

Please sign in to comment.