summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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`_ =)