title: Play 2.3: How to pass parameter to custom action
body: <p>My current custom action is this</p>
  
  <pre><code>class UserRequest[A](val user: Option[models.UserProfile],
                       request: Request[A]) extends WrappedRequest[A](request)
  
  object UserAction extends ActionBuilder[UserRequest] with ActionTransformer[Request, UserRequest] {
  
    def transform[A](request: Request[A]) = Future.successful {
      val user = ... get user from session
        new UserRequest(user, request)
    }
  }
  </code></pre>
  
  <p>Additionally, I want to pass a parameter to UserAction (e.g. role to validate). So in controller I can use it in this way:</p>
  
  <pre><code>def admin = UserAction("admin") { Ok("granted") }
  </code></pre>