Overiding delete permissions in the Admin
|Reported by:||anonymous||Owned by:||nobody|
|Cc:||Melvyn Sopacua||Triage Stage:||Accepted|
|Has patch:||no||Needs documentation:||yes|
|Needs tests:||no||Patch needs improvement:||no|
The ModelAdmin delete permission is controlled by the get_delete_permission function which can be overridden by subclasses. However when actually deleting an object the permission checking is passed off to util.get_deleted_objects and then in format callback it does this.
p = '%s.%s' % (opts.app_label, opts.get_delete_permission())
Which goes back to checking the permissions on the models meta class. Which makes whatever behavior you specified in get_delete_permission irrelevant.
Change History (7)
comment:5 Changed 5 years ago by
|Cc:||Melvyn Sopacua added|
|Triage Stage:||Unreviewed → Design decision needed|