how can i check in javascript if user has granted my site the publish stream permission
?
In the new Graph API (including via JavaScript) this can be accomplished by accessing "/[user]/permissions".
From the User object documentation:
permissions
The permissions that user has granted the application.
arraycontaining a single object which has the keys as the permission names and the values as the permission values (1/0) - Permissions with value 0 are omitted from the object by default; also includes atypefield which is alwayspermissions.