jazzband/django-authority

BasePermission.assign overwrites permission if it exists for another group, fails if two exist

gthb opened this issue · 0 comments

gthb commented

In BasePermission.assign, no group parameter is passed to Permission.objects.get and .create. As a result:

  1. if a permission instance for a different group exists, it is overwritten instead of assigning a new permission instance for self.group
  2. if two permission instances for different groups exist, a MultipleObjectsReturned exception is raised

(Copied from PolicyStat/django-authority#13, originally from https://bitbucket.org/jezdez/django-authority/issue/16/)