Opened 15 years ago
Closed 15 years ago
#12211 closed (duplicate)
Admin inlines do not respect group permissions
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | 1.1 |
Severity: | 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
I believe this may be similar to ticket #8060.
I have two models, Category and SubCategory with SubCategory having a foreignkey relationship to Category. SubCategory is set up to be edited inline with Category in the Admin interface. I have defined a Group named Supervisor which does not have permission to delete from either Category or SubCategory. When the Category is edited, the delete option is hidden for the Category, but the delete checkboxes for the SubCategories are displayed and if checked, the SubCategories are actually deleted when the category is saved (note, is_superuser is not selected).
class SubCategoryInline(admin.TabularInline): model = models.SubCategory extra=5 class CategoryAdmin(admin.ModelAdmin): inlines = [SubCategoryInline] admin.site.register(models.Category, CategoryAdmin)
Yes, this is a dupe of #8060.