Skip to content

Commit

Permalink
Better upgrading guide
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Apr 5, 2014
1 parent eb05113 commit 0b11205
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Guides/security.md
Expand Up @@ -69,8 +69,11 @@ If you know what you are doing, you can disable safe key access altogether, remo
This can be done globally for all renderings:

```objc
GRMustacheConfiguration *config = [GRMustacheConfiguration defaultConfiguration];
config.baseContext = [config.baseContext contextWithUnsafeKeyAccess];
// Grant GRMustache unsafe access to `valueForKey:`, so that we do not have
// to explicitly declare properties on objects that feed templates.

GRMustacheConfiguration *configuration = [GRMustacheConfiguration defaultConfiguration];
configuration.baseContext = [configuration.baseContext contextWithUnsafeKeyAccess];
```

`GRMustacheConfiguration` is described in the [Configuration Guide](configuration.md).
Expand Down
3 changes: 3 additions & 0 deletions Guides/upgrading.md
Expand Up @@ -41,6 +41,9 @@ This default behavior can be customized to fit your needs: see the [Security Gui
The easiest way to restore the previous behavior of the library is to evaluate the following code prior to any rendering:

```objc
// Grant GRMustache unsafe access to `valueForKey:`, so that we do not have
// to explicitly declare properties on objects that feed templates.

GRMustacheConfiguration *configuration = [GRMustacheConfiguration defaultConfiguration];
configuration.baseContext = [configuration.baseContext contextWithUnsafeKeyAccess];
```
Expand Down

0 comments on commit 0b11205

Please sign in to comment.