title: How can I specify the Facebook permissions (aka scope) OmniAuth asks for DYNAMICALLY?
body: <p>This question is similar to <a href="https://stackoverflow.com/questions/4062065/how-can-i-specifiy-what-access-i-need-from-my-users-facebook-accounts-when-using">How can I specifiy what access I need from my user&#39;s Facebook accounts when using OmniAuth?</a> but has a caveat.</p>
  
  <p>I'm using OmniAuth to authorize Facebook users on my website. For regular login/registration, asking the user for standard Facebook permissions are acceptable. But there is a feature on my site that requires extended permissions (access to their Facebook photos). I want to only ask for the extended permissions for users when/if they use our site's Facebook photo feature.</p>
  
  <p>All answers I've found on the web on how to set facebook permissions for omniauth deal with just adding a scope option in your OmniAuth initializer, like so:</p>
  
  <pre><code>ActionController::Dispatcher.middleware.use OmniAuth::Strategies::Facebook, 'app_id', 'app_secret', {:scope =&gt; 'email,offline_access,the,scope,you,want}
  </code></pre>
  
  <p>But I need to define the scope dynamically, so that only when users use the photo feature they get asked for the photo permissions, but not if they are just logging in or registering for the first time.</p>
  
  <p>Anyone know how to do this? Thanks in advance.</p>