summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authormthompson <flippmoke@gmail.com>2013-05-07 21:26:23 +0000
committermthompson <flippmoke@gmail.com>2013-05-07 21:26:23 +0000
commit273d5139a880a90dc6afd658199339af8e031e6d (patch)
tree9fee55c83dafd87de7a33f589c016baf8107a72f /docs
parent43887add3a7bdccfdc5af9bde43559101cd3ed02 (diff)
downloadoauthlib-273d5139a880a90dc6afd658199339af8e031e6d.tar.gz
Updated the documentation for dynamic scopes.
Diffstat (limited to 'docs')
-rw-r--r--docs/server2.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/server2.rst b/docs/server2.rst
index af8f66e..3851426 100644
--- a/docs/server2.rst
+++ b/docs/server2.rst
@@ -309,6 +309,19 @@ Note that OAuth 2 provider is still very much a work in progress, consider it a
# May be bound to various scopes of your choosing
return HttpResponse('pictures of cats')
+ The set of scopes that protects a view may also be dynamically configured
+ at runtime by a function, rather then by a list::
+
+ def dynamic_scopes(request):
+ # Place code here to dynamically determine the scopes
+ # and return as a list
+ return ['images']
+
+ @provider.protected_resource_view(scopes=dynamic_scopes)
+ def i_am_also_protected(request, client, resource_owner, **kwargs)
+ # A view that has its views functionally set.
+ return HttpResponse('pictures of cats')
+
**7. Let us know how it went!**
Drop a line in our `G+ community`_ or open a `GitHub issue`_ =)