bshaffer/oauth2-server-php — pull request #66 by AdamZ (2013-02-25 22:24:46+00:00)
Title: Scope customization

This partially solves issue #62. I added $client_id as a parameter to getSupportedScopes(). I tried adding $user_id as well, but since getSupportedScopes is called when the login page is first displayed (i.e., before we know which user is logging in) it's fairly useless to support it there.

If you want to be able to specify allowed scopes based on the user id, you'll probably have to add a new method to OAuth2_Storage_ScopeInterface, which only gets called when the code/token is about to be generated.