Skip to content

can_undelete permission is not model specific #105

@wmacbmcd

Description

@wmacbmcd

If i'm creating two models, and inheriting the meta class on both, a can_undelete permission will be created for each of them.

class ModelA(SoftDeleteObject, models.Model):
    class Meta(SoftDeleteObject.Meta):
        verbose_name = "Model A"

    some_field = models.CharField() 
class ModelB(SoftDeleteObject, models.Model):
    class Meta(SoftDeleteObject.Meta):
        verbose_name = "Model A"

    some_field = models.CharField()

If i then assign the can_undelete permission for ModelA to user1, and assign can_delete for ModelB to user2, both users will be able to undelete ModelA and ModelB objects, because the permission's codename is not unique.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions