Implement hashing bypass for groups

This commit is contained in:
2022-08-16 19:43:55 +01:00
parent e67eee8cc8
commit e08a7677ef
11 changed files with 123 additions and 63 deletions

View File

@@ -104,15 +104,12 @@ class ContentBlock(models.Model):
super().save(*args, **kwargs)
class Role(models.Model):
name = models.CharField(max_length=255, unique=True)
description = models.CharField(max_length=1024, null=True, blank=True)
permission = models.CharField(max_length=255)
def __str__(self):
return self.name
class ContentPermission(models.Model):
inherit = models.ForeignKey("self", null=True, blank=True, on_delete=models.PROTECT)
roles = models.ManyToManyField(Role, blank=True)
class Perms(models.Model):
class Meta:
permissions = (
("bypass_hashing", "Can bypass field hashing"),
("bypass_blacklist", "Can bypass the blacklist"),
("bypass_encryption", "Can bypass field encryption"),
("post_irc", "Can post to IRC"),
("post_discord", "Can post to Discord"),
)