title: Django - get current user permissions in a view?
body: <p>Im trying to get the current logged on users permissions</p>
  
  <p>My current attempt below returns an error</p>
  
  <pre><code>   from django.contrib.auth.models import Permission
     from django.contrib.auth.models import User
     permissions = Permission.objects.filter(user=User.id)
  </code></pre>
  
  <p>Error</p>
  
  <blockquote>
    <p>int() argument must be a string, a bytes-like object or a number, not 'DeferredAttribute'</p>
  </blockquote>
  
  <p>does anyone know how I can do this? is there a simpler way?</p>
  
  <p>Thanks</p>