sromku/android-simple-facebook — pull request #43 by ronlut (2013-11-24 21:54:34+00:00)
Title: Fix reopen session flow (when called with IsRead=false)

So I dived into the code, and encountered a problem:
In a scenario when a session exists and needs to be reopened, and the needed permissions are publish which are already authorized in the existing session the original code would do that:

openSession(session, false);
And then `openSession` will try to do that:

request.setPermissions(mConfiguration.getReadPermissions()); // Set only read permissions to the request
session.openForPublish(request); // Open for publish with only read permissions
And it will always fail with the following `FacebookException`:
> "Cannot request publish or manage authorization with no permissions."

because `session.open` validates the permissions and sees there are no publish permissions in the request.
What I did is split the `setPermissions` parts to two scenarios:

1. We want to open a session with a read (and optionally publish) permission
2. We want to reopen a session with a publish permission

Hope I described it properly, and of course waiting for any input / corrections.