diff --git a/pyfb/client.py b/pyfb/client.py index 095f9f6..e3b7411 100755 --- a/pyfb/client.py +++ b/pyfb/client.py @@ -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): diff --git a/pyfb/pyfb.py b/pyfb/pyfb.py index fce20d9..e3809cd 100644 --- a/pyfb/pyfb.py +++ b/pyfb/pyfb.py @@ -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): """