make role IDs into constants #226

This commit is contained in:
rimu 2024-06-27 15:20:37 +08:00
parent 8548f3e2a2
commit 6f2eef0eb8

View file

@ -117,6 +117,8 @@ def register(app):
print("Added 'Peertube Isolation' blocklist, see https://peertube_isolation.frama.io/")
# Initial roles
# These roles will create rows in the 'role' table with IDs of 1,2,3,4. There are some constants (ROLE_*) in
# constants.py that will need to be updated if the role IDs ever change.
anon_role = Role(name='Anonymous user', weight=0)
anon_role.permissions.append(RolePermission(permission='register'))
db.session.add(anon_role)