Implement ACLs

This commit is contained in:
evilchili
2025-10-05 00:15:37 -07:00
parent 36006ceeea
commit 0e8fd9a1b0
6 changed files with 204 additions and 58 deletions
+6 -3
View File
@@ -1,12 +1,11 @@
from dataclasses import dataclass, field
from functools import cached_property
from flask import g
from grung.types import BackReference, Collection, Pointer, Record
from ttfrog import schema
from flask import g
READ_ONLY_FIELD_TYPES = [Collection, Pointer, BackReference]
@@ -15,6 +14,7 @@ class Form:
"""
The base Form controller for the web UI.
"""
record: Record
data: field(default_factory=dict)
@@ -26,7 +26,6 @@ class Form:
def prepare(self):
for key, value in self.data.items():
# filter out fields that cannot be set by the user
if key in self.read_only:
continue
@@ -41,6 +40,7 @@ class Page(Form):
"""
A form for creating and updating Page records.
"""
record: schema.Page
@cached_property
@@ -53,6 +53,7 @@ class NPC(Page):
"""
A form for creating and updating Page records.
"""
record: schema.NPC
@@ -61,6 +62,7 @@ class User(Page):
"""
A form for creating and updating Page records.
"""
record: schema.NPC
@@ -69,4 +71,5 @@ class Group(Page):
"""
A form for creating and updating Page records.
"""
record: schema.NPC