How to check the facebook application permission for specific user through graph api in rails?
Asked Answered
O

3

7

I want to check whether the user has give publish_stream permission to my application or not. If not want to get publish_stream permission.

Oldcastle answered 17/11, 2011 at 12:47 Comment(0)
L
22

if you are using the Koala Gem just use:

#check wether wallpost is allowed
permissions = graph.get_connections('me','permissions')
@has_wallpost_permission = permissions.select{|o| o['permission'] == 'manage_pages'}.length == 1 
Laudable answered 24/11, 2011 at 11:33 Comment(1)
That's half of it but how do you tell Koala to request certain permissions from the user when they authorise the app?Indrawn
U
0

You must autorize user with publish_stream permission. In rails I do it with OmniAuth gem.

My post can help you - Publish stream in Facebook & Twitter with OmniAuth

Unbroken answered 17/11, 2011 at 14:40 Comment(2)
The scenario is the user has authorize the app. I want to check if the user given certain permission to my app. if not I want to take that permission. Is this possible in facebook graph API or in rails 3. My app is running in facebook canvas.Oldcastle
You can use FQL query to check permissionUnbroken
A
0

If you don't use Koala you can send request 'GET /{user-id}/permissions' This is described in 'Checking Current Permissions' section here https://developers.facebook.com/docs/facebook-login/permissions/v2.1

Authenticity answered 11/9, 2014 at 10:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.