Search code examples
facebookpermissionsadminfacebook-authentication

How can i see if current user is admin of facebook canvas app


I am working in a facebook canvas app which has an edit settings page. I need to protect that page so only the application administrators have access to it.

I couldn´t find any information about how to do this. This should be a pretty basic feature.

Any ideas?


Solution

  • FQL

    SELECT uid, page_id, type from page_admin WHERE page_id=YOUR_APP_ID AND uid=me()
    

    Graph

    Alternatively, you can get the Pages/Applications that the user is admin of using:

    https://graph.facebook.com/me/accounts
    

    Your app will require the manage_pages permission. For more details see: http://developers.facebook.com/docs/authentication/#page-login