Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29967 closed Bug (duplicate)

Django Admin Inlines, for users who only have "view" permission on the inline model, return Validation errors.

Reported by: Matija Kolarić Owned by: nobody
Component: contrib.admin Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The way to reproduce:

  1. Make three models, two with a FKs to the first one, and create ModelAdmin for one, that includes inlines for the other two.
  1. Create a new object with both inline types with a user who has ass/change permissions to everything.
  1. Open the same changeview with a user that has change permission for the main model and one of the inlines, and only view permission for the other inline model.
  1. Save

What happens is that Validation Error is raised (which is not visible, but present in form.errors) stating that the fields in the inline are required.

What should happen is that the whole inline should really be ignored, basically, the behaviour should be the same as if the user did not even have the "view" permission for the inline.

Change History (2)

comment:1 by Tim Graham, 6 years ago

Resolution: duplicate
Status: newclosed
Type: UncategorizedBug

Duplicate of #29930.

comment:2 by Matija Kolarić, 6 years ago

Also, likely related to this, if the view has save_as, and there is an error, then, although the user has only view permission for the inline mode, the formset is shown as if the user had add permission, though nothing happens with the entered data.

Note: See TracTickets for help on using tickets.
Back to Top