title: Cakephp 4 show only logged in user data
body: <p>I am pretty new in CakePHP, working with CMS tutorial.
  In the end, I'd like list all users, if logged in user is 'admin', if not, only the active user in users/index.</p>
  <p>At first, I've tried to get logged in user data and search the user in db, but it not works.
  My code is:</p>
  <pre><code> public function index()
      {
  
          
          $this-&gt;Authorization-&gt;skipAuthorization();
          $user=$this-&gt;request-&gt;getAttribute('identity');
          $user-&gt;get('user_id');       
          
  
          $users = $this-&gt;paginate($this-&gt;Users-&gt;get($user));  
  
          $this-&gt;set(compact('users'));
      }
  </code></pre>
  <p>The error is:</p>
  <pre><code>Record not found in table &quot;users&quot; with primary key [App\Model\Entity\User::__set_state(array(
  </code></pre>