title: Permit extra params in special cases with Strong Params in Rails 4
body: <p>So for an organization, I want users to be able to be able to edit some things about it.</p>
  
  <pre><code>params.require(:organization).permit(:name, :location)
  </code></pre>
  
  <p>But in special cases, I want administrators to be able to edit extra attributes</p>
  
  <pre><code>params.require(:organization).permit(:name, :location, :secrets)
  </code></pre>
  
  <p>Now I know I can just have an if statement to choose which line I want to use, but since the admin will always be able to edit the original attributes, I wanted to easily be able to include them like so:</p>
  
  <pre><code>permitted = params.require(:organization).permit(:name, :location)
  permitted.permit(:secrets) if current_user.admin?
  </code></pre>
  
  <p>Is there any way to chain permit calls like that? Or do I have to do something like store the attributes in an array and conditionally add extra before making the permit call?</p>