docs: def editpermissions_index_view(self, request, forum_id=None):
          """ Allows to select how to edit forum permissions.
  
          The view displays a form to select a user or a group in order to edit its permissions for
          the considered forum.
  
          """
          forum = get_object_or_404(Forum, pk=forum_id) if forum_id \
              else None
  
          # Set up the context
          context = self.get_forum_perms_base_context(request, forum)
          context['forum'] = forum
          context['title'] = _('Forum permissions') if forum else _('Global forum permissions')
  
          # Handles "copy permission from" form
          permissions_copied = False
          if forum and request.method == 'POST':
              forum_form = PickForumForm(request.POST)
              if forum_form.is_valid() and forum_form.cleaned_data['forum']:
                  self._copy_forum_permissions(forum_form.cleaned_data['forum'], forum)
                  self.message_user(request, _('Permissions successfully copied'))
                  permissions_copied = True
              context['forum_form'] = forum_form
          elif forum:
              context['forum_form'] = PickForumForm()
  
          # Handles user or group selection
          if request.method == 'POST' and not permissions_copied:
              user_form = PickUserForm(request.POST, admin_site=self.admin_site)
              group_form = PickGroupForm(request.POST, admin_site=self.admin_site)
  
              if user_form.is_valid() and group_form.is_valid():
                  user = user_form.cleaned_data.get('user', None) if user_form.cleaned_data else None
                  anonymous_user = (
                      user_form.cleaned_data.get('anonymous_user', None)
                      if user_form.cleaned_data else None
                  )
                  group = (
                      group_form.cleaned_data.get('group', None)
                      if group_form.cleaned_data else None
                  )
  
                  if not user and not anonymous_user and not group:
                      user_form._errors[NON_FIELD_ERRORS] = user_form.error_class(
                          [_('Choose either a user ID, a group ID or the anonymous user'), ])
                  elif user:
                      # Redirect to user
                      url_kwargs = (
                          {'forum_id': forum.id, 'user_id': user.id}
                          if forum else {'user_id': user.id}
                      )
                      return redirect(
                          reverse('admin:forum_forum_editpermission_user', kwargs=url_kwargs),
                      )
                  elif anonymous_user:
                      # Redirect to anonymous user
                      url_kwargs = {'forum_id': forum.id} if forum else {}
                      return redirect(
                          reverse(
                              'admin:forum_forum_editpermission_anonymous_user',
                              kwargs=url_kwargs,
                          ),
                      )
                  elif group:
                      # Redirect to group
                      url_kwargs = (
                          {'forum_id': forum.id, 'group_id': group.id}
                          if forum else {'group_id': group.id}
                      )
                      return redirect(
                          reverse('admin:forum_forum_editpermission_group', kwargs=url_kwargs),
                      )
  
              context['user_errors'] = helpers.AdminErrorList(user_form, [])
              context['group_errors'] = helpers.AdminErrorList(group_form, [])
          else:
              user_form = PickUserForm(admin_site=self.admin_site)
              group_form = PickGroupForm(admin_site=self.admin_site)
  
          context['user_form'] = user_form
          context['group_form'] = group_form
  
          return render(request, self.editpermissions_index_view_template_name, context)