title: "you don't have permission to edit anything" on custom AdminSite if user is not superuser
body: <p>I wan't to have multiple AdminSite on my Django project and I don't want to give every user the superuser role just to see and edit the models of the application.</p>
  
  <p>Here is the layout of my project:</p>
  
  <pre><code>&gt; djangoApp
      &gt; djangoApp
          - settings.py
          - etc...
      &gt; AAA
          - admin.py
          - urls.py
          - etc..
      &gt; BBB
          - admin.py
          - urls.py
          - etc..
      &gt; CCC
          - admin.py
          - urls.py
          - etc..
      &gt; ressources
          - models.py
          - etc..
      &gt; core
          - admin.py
          - auth.py
          - models.py
          - views.py
  </code></pre>
  
  <p>Here is the admin.py of BBB (I use a different database for each AdminSite):</p>
  
  <pre><code>from django.contrib import admin
  from django.contrib.admin import AdminSite, site
  from core.admin import UserAuthenticationForm
  from ressources.models import Adresse
  
  
  class BBBAdminSite(AdminSite):
      site_header = 'BBB admin'
  
      login_form = UserAuthenticationForm
      login_template = "core/login.html"
  
      def has_permission(self,request):
  
          user = request.user
  
          return user.is_active and user.is_staff and (user.account_id == 100 or user.account_id == 0)
  
  class AdminModel(admin.ModelAdmin):
  
      using = 'DATABASE_NAME'
  
      def has_add_permission(self, request):
  
          user = request.user
          return user.is_active and user.is_staff and (user.account_id == 100 or user.account_id == 0)
  
      def has_change_permission(self, request, obj=None):
  
          user = request.user
          return user.is_active and user.is_staff and (user.account_id == 100 or user.account_id == 0)
  
      def has_delete_permission(self, request, obj=None):
  
          user = request.user
          return user.is_active and user.is_staff and (user.account_id == 100 or user.account_id == 0)
  
      def save_model(self, request, obj, form, change):
          user = request.user
          obj.account_id = user.account_id
          obj.save(using=self.using)
  
      def delete_model(self, request, obj):
          obj.delete(using=self.using)
  
      def get_queryset(self, request):
          return super(AdminModel, self).get_queryset(request).using(self.using)
  
      def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
          return super(AdminModel, self).formfield_for_foreignkey(db_field, request=request, using=self.using, **kwargs)
  
      def formfield_for_manytomany(self, db_field, request=None, **kwargs):
          return super(AdminModel, self).formfield_for_manytomany(db_field, request=request, using=self.using, **kwargs)
  
  bbbAdmin = BBBAdminSite(name='bbbAdmin')
  
  
  bbbAdmin.register(Adresse, AdminModel) ### The user can see this in the admin dashboard only if he is superuser
  </code></pre>
  
  <p>Here is the urls.py of the same app:</p>
  
  <pre><code>from django.contrib import admin
  from django.urls import include, path, re_path
  from BBB.admin import bbbAdmin
  
  
  urlpatterns = [
      path('', bbbAdmin.urls),
  ]
  </code></pre>
  
  <p>I use a different AuthBackend to authenticate my users:</p>
  
  <p>core/auth.py:</p>
  
  <pre><code>from django.conf import settings
  from django.contrib.auth.hashers import check_password
  from .models import User
  
  class AuthBackend(object):
  
  def has_perm(self, user_obj, perm, obj=None):
      if(obj != None):
          return (obj.account_id == user_obj.account_id)
      return False
  
  def get_user(self, user_id):
      try:
          return User.objects.get(pk=user_id)
      except User.DoesNotExist:
          return None
  
  def authenticate(username=None, password=None, account_id=None):
  
      try:
          user = User.objects.get(username=username, account_id=account_id)
      except User.DoesNotExist:
          return None
  
      pwd_valid = check_password(password, user.password)
  
      if pwd_valid:
          return user
      else:
          return None
  </code></pre>
  
  <p>I have registered the AuthBackend in my settings.py:</p>
  
  <pre><code>AUTHENTICATION_BACKENDS = ('core.auth.AuthBackend',)
  </code></pre>
  
  <p>I tried to change it to:</p>
  
  <pre><code>AUTHENTICATION_BACKENDS = ('core.auth.AuthBackend', 'django.contrib.auth.backends.ModelBackend',)
  </code></pre>
  
  <p>But it gives me the error </p>
  
  <blockquote>
    <p>You have multiple authentication backends configured and therefore must provide the <code>backend</code> argument or set the <code>backend</code> attribute on the user.</p>
  </blockquote>
  
  <p>I have tried to put the user in a group which had all the permissions, but it still displays "you don't have permission to edit anything" when he logins.
  The user has is_staff set to True</p>