Skip to content

Commit

Permalink
removed to ask for all permissions by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jmg committed Nov 25, 2013
1 parent 1b98b61 commit be2bd3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions pyfb/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,23 @@ class FacebookClient(object):
BASE_TOKEN_URL = "%soauth/access_token?" % GRAPH_URL

DEFAULT_REDIRECT_URI = "http://www.facebook.com/connect/login_success.html"
DEFAULT_SCOPE = auth.ALL_PERMISSIONS
DEFAULT_SCOPE = [auth.USER_ABOUT_ME]
DEFAULT_DIALOG_URI = "http://www.example.com/response/"

#A factory to make objects from a json
factory = Json2ObjectsFactory()

def __init__(self, app_id, access_token=None, raw_data=None):
def __init__(self, app_id, access_token=None, raw_data=False, permissions=None):

self.app_id = app_id
self.access_token = access_token
self.raw_data = raw_data
self.permissions = self.DEFAULT_SCOPE

if permissions is None:
self.permissions = self.DEFAULT_SCOPE
else:
self.permissions = permissions

self.expires = None

def _make_request(self, url, data=None):
Expand Down
4 changes: 2 additions & 2 deletions pyfb/pyfb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class Pyfb(object):
This class is Facade for FacebookClient
"""

def __init__(self, app_id, access_token=None, raw_data=False):
def __init__(self, app_id, access_token=None, raw_data=False, permissions=None):

self._client = FacebookClient(app_id, access_token, raw_data)
self._client = FacebookClient(app_id, access_token=access_token, raw_data=raw_data, permissions=permissions)

def authenticate(self):
"""
Expand Down

0 comments on commit be2bd3e

Please sign in to comment.