Permalink
Browse files

Merge branch 'perms' into develop

  • Loading branch information...
2 parents b67ebe4 + f2d5eca commit 1b1494d8d6dcc6707bd4d5d9b7c163889e0a58c1 @tburke tburke committed Apr 18, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 pyramid_facebookauthentication/__init__.py
@@ -27,8 +27,8 @@ def remember(self, request, principal, **kw):
def forget(self, request):
return self.fbuser.forget(request)
- def login_view(self, context, request, redir_url=None):
- return self.fbuser.login_view(request, redir_url)
+ def login_view(self, context, request, redir_url=None, scope=None):
+ return self.fbuser.login_view(request, redir_url, scope)
class FacebookAuthHelper(object):
@@ -69,9 +69,11 @@ def identify(self, request):
return identity
- def login_view(self, request, redir_url):
+ def login_view(self, request, redir_url, scope):
url = redir_url or self.app_url
- return Response("<script type='text/javascript'>top.location.href = 'https://www.facebook.com/dialog/oauth?client_id={0}&redirect_uri={1}&type=user_agent&display=page&scope={2}';</script>".format(self.app_id, urllib.quote(url + request.path_info + '?' + request.query_string), self.app_permissions))
+ if not scope:
+ scope = self.app_permissions
+ return Response("<script type='text/javascript'>top.location.href = 'https://www.facebook.com/dialog/oauth?client_id={0}&redirect_uri={1}&type=user_agent&display=page&scope={2}';</script>".format(self.app_id, urllib.quote(url + request.path_info + '?' + request.query_string), scope))
def _key_from_request(self, request, key):
if key in request.params:

0 comments on commit 1b1494d

Please sign in to comment.