Answers.Body: <p>You don’t need to dynamically set the <code>postCpLoginRedirect</code> template, you can point to a single, unified template. Once the user has been redirected, make all of your dynamic decisions <em>within the Twig template</em>.</p>
  <p>If you want to then choose to redirect to <em>yet another</em> template, just use the Twig <code>redirect</code> tag.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-22T15:14:10.863Z
Answers.LastActivityDate: 2020-06-22T15:14:10.863Z
Answers.UserDisplayName: Lindsey D
Body: <p>I'm wondering if it's possible to set the postCpLoginRedirect config setting dynamically during plugin initialization. Seems like that's a no-go, but wanted to confirm. Ideally, I'd like to ID users with very limited CP access and direct them straight to their view's url (effectively skipping the dashboard for this user group only). I would welcome suggestions for best-practice workarounds/alternatives if dynamic setting of this property is not possible. Thanks!</p>
  
Tags: <plugin-development>
Title: Dynamic postCpLoginRedirect based on user permissions
ThreadText: # Dynamic postCpLoginRedirect based on user permissions
  
  (Asked by: username_0 on 2020-06-22)
  
  I'm wondering if it's possible to set the postCpLoginRedirect config setting dynamically during plugin initialization. Seems like that's a no-go, but wanted to confirm. Ideally, I'd like to ID users with very limited CP access and direct them straight to their view's url (effectively skipping the dashboard for this user group only). I would welcome suggestions for best-practice workarounds/alternatives if dynamic setting of this property is not possible. Thanks!
  
  **Tags:** plugin-development
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-22. Score: 3
  
  You don’t need to dynamically set the `postCpLoginRedirect` template, you can point to a single, unified template. Once the user has been redirected, make all of your dynamic decisions *within the Twig template*.
  
  If you want to then choose to redirect to *yet another* template, just use the Twig `redirect` tag.
  
  
  ---
  
  