django-tabular-permissions icon indicating copy to clipboard operation
django-tabular-permissions copied to clipboard

fix: reminder_perms not work with extra default_permissions

Open DemidovEvg opened this issue 1 year ago • 3 comments

DemidovEvg avatar Mar 24 '24 11:03 DemidovEvg

Hello ! Interesting approach ... May i ask about the use case, why would you need to edit the default permissions as oppose to add it to the model's Meta permissions ?

Thank you

RamezIssac avatar Mar 28 '24 16:03 RamezIssac

Hello! I use models permissions for turning off visibility models from app list:

class SomeModel(models.Model):
   class Meta(BaseMeta):
     permissions = [('can_see_in_app_list_somemodel', 'Can see SomeModel in app list')]

I have a lot of models like this. But I think best desicion will be create base Meta like this:

class BaseMeta:
   default_permissions = ('add', 'change', 'delete', 'view', 'see_in_app_list')

class SomeModel(models.Model):
   class Meta(BaseMeta):
      pass

And django will automatically create permissions with verbose name and correct value.

DemidovEvg avatar Mar 28 '24 18:03 DemidovEvg

Hello

Well, I never thought to use it like this (nor i agree with the conclusion that it's better to be in the default_permissions rather than the permissions tbh) However, if it's made possible by Django, then it should be supported i believe.

Will revise and most probably merge , and will release soon anyway. Thank you @DemidovEvg !

RamezIssac avatar Mar 29 '24 11:03 RamezIssac

Hello @RamezIssac, is there a scheduled date for the next release?

SteMazzO avatar Apr 18 '24 09:04 SteMazzO

Thank you @SteMazzO @DemidovEvg

Released https://pypi.org/project/django-tabular-permissions/2.9.3/

RamezIssac avatar Apr 19 '24 17:04 RamezIssac