# Custom blueprint for different roles

**URL:** <https://forum.getkirby.com/t/custom-blueprint-for-different-roles/12272>\
**Category:** Questions\
**Tags:** v3\
**Created:** [January 19, 2019, 7:47pm UTC](https://forum.getkirby.com/t/custom-blueprint-for-different-roles/12272 "2019-01-19T19:47:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![gillesvauvarin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gillesvauvarin/32/2351_2.png) [@gillesvauvarin](https://forum.getkirby.com/u/gillesvauvarin)\
**Post date:** [January 19, 2019, 7:57pm UTC](https://forum.getkirby.com/t/custom-blueprint-for-different-roles/12272/2 "2019-01-19T19:57:47Z")

</div>

Hi David,

Check this example, it allows you to switch to different panel according to the user role.  
It use the “custom folder setup” Kirby concept to choose which blueprint folder will be used by Kirby  
“candidate” and “evaluator” are custom roles created in /site/blueprints/users/  
“blueprintcandidate” and “blueprintevaluator” are folder created in site/ to host panel config files

This code must be added into the index.php file

```auto
require __DIR__. '/kirby/bootstrap.php';

$kirby = new Kirby();

$current_user = $kirby->user();

if ( $current_user && $current_user->role() == 'candidate' ):
   $kirby = new Kirby([
       'roots' => [
           'blueprints' => __DIR__. '/site/blueprintcandidate',
       ],
   ]);

elseif ( $current_user && $current_user->role() == 'evaluator' ):
   $kirby = new Kirby([
       'roots' => [
           'blueprints' => __DIR__. '/site/blueprintevaluator',
       ],
   ]);
endif;

echo $kirby->render();

```

---

_[View the full topic](https://forum.getkirby.com/t/custom-blueprint-for-different-roles/12272)._
