title: Yii2 Menu Bar Visibility to a Specific User
body: <p>In my <code>main.php</code>, I have a menu:</p>
  
  <pre><code>'items' =&gt; [
      ['label' =&gt; 'Home', 'url' =&gt; ['/site/index']],
      ['label' =&gt; 'Biz Staff', 'url' =&gt; ['bizstaff/index'], 'visible' =&gt; User::isBizAdmin(), 'items' =&gt; [
          ['label' =&gt; 'Staff List', 'url' =&gt; 'index.php?r=user/index'],
          ['label' =&gt; 'Add Staff', 'url' =&gt; 'index.php?r=user/create'],
      ]],
  
      ['label' =&gt; 'Transaction', 'url' =&gt; ['transactions/index'], 'visible' =&gt; User::isBizAdmin() || User::isBizStaff(), 'items' =&gt; [
          ['label' =&gt; 'Transactions', 'url' =&gt; 'index.php?r=transactions/index'],
          ['label' =&gt; 'Add Transactions', 'url' =&gt; 'index.php?r=transactions/create'],
      ]],
  
      Yii::$app-&gt;user-&gt;isGuest ?
          ['label' =&gt; 'Login', 'url' =&gt; ['/site/login']] :
          ['label' =&gt; 'Logout (' . Yii::$app-&gt;user-&gt;identity-&gt;username . ')',
            'url' =&gt; ['/site/logout'],
            'linkOptions' =&gt; ['data-method' =&gt; 'post']
          ],
      ],
  </code></pre>
  
  <p>Here, I am logged in as the <strong>superadmin</strong> (note that only <em>Home</em> and <em>Logout</em> menu is visible to <em>superadmin</em> user). Inside the homepage (Home menu) is a <em>List of Biz Admins</em> which is placed inside a <code>GridView</code> widget. It has an <em>Action</em> column where <em>view, update and delete icons</em> are placed. When I click the view icon of a specific Biz Admin, it will then render a detailed view page of that Biz Admin where its <strong>Store Name</strong> and <strong>List of Staff</strong> are seen. In this page, there is a <strong>View Store</strong> button which will redirect to the <code>bizadmin</code> view/page.</p>
  
  <p>Whenever <em>superadmin</em> lands on <code>bizadmin</code> view/page, the menu bar should now change to: </p>
  
  <blockquote>
    <p>Home, Biz Staff, Transaction, Logout</p>
  </blockquote>
  
  <p>How do I do this? Is it set in the <code>visible</code> attribute? 
  Any of your answers would be highly appreciated. I am currently stuck in this problem.</p>