Closed nnseva closed 12 years ago
Can you please verify, that in django if ChildModel is inlined in ParentModel, and the user has permission to add ParentModel but not ChildModel, that the add button is gone? If I remember correctly, this doesn't work correctly in django and is the cause for the problem you observe.
class ParentModel(models.Model):
title = models.CharField(max_length=5)
class ChildModel(models.Model):
parent = models.ForeignKey(ParentModel)
class ChildModelInline(admin.StackedInline):
model = ChildModel
class ParentModelAdmin(admin.ModelAdmin):
inlines = [ChildModelInline]
admin.site.register(ParentModel, ParentModelAdmin)
Please test in a new project.
Yes you right, it doesn't work in an original django admin ... let me send an issue there ...
Just to inform you that this issue has been closed 4 weeks ago in django trunk, hope to see it in the next django release: https://code.djangoproject.com/ticket/8060
Good to know. Be aware that easy mode is not yet compatible with the trunk. Someone reported to me the i18n features are not working. I will fix it and make sure all the unit tests pass as soon as a release candidate is available.
Let we have two classes, f.e.:
and tree admin view where the Top is a root object class, while Bottom is a leaf object class.
User having no permissions to add a new Bottom object should not see the "Add ..." button in a tree view User having no permissions to add a new Bottom object should not see the empty Bottom object in a tree view User having no permissions to edit the Bottom object should not see the "Edit ..." button/link in a tree view User having no permissions to edit the Bottom object should not see editable fields in a tree view User having no permissions to delete the Bottom object should not see the "Delete ..." checkbox in a tree view