Include permissions in TemplatedAttr context

This commit is contained in:
Jeremy Stretch
2026-04-01 16:48:19 -04:00
parent c9073aca3c
commit 623ab55d5b
2 changed files with 2 additions and 1 deletions

View File

@@ -506,6 +506,7 @@ class TemplatedAttr(ObjectAttribute):
def get_context(self, obj, context): def get_context(self, obj, context):
return { return {
**context,
**self.context, **self.context,
'object': obj, 'object': obj,
} }

View File

@@ -187,7 +187,7 @@ class ObjectAttributesPanel(ObjectPanel, metaclass=ObjectAttributesPanelMeta):
'attrs': [ 'attrs': [
{ {
'label': attr.label or self._name_to_label(name), 'label': attr.label or self._name_to_label(name),
'value': attr.render(ctx['object'], {'name': name}), 'value': attr.render(ctx['object'], {'name': name, 'perms': ctx['perms']}),
} for name, attr in self._attrs.items() if name in attr_names } for name, attr in self._attrs.items() if name in attr_names
], ],
} }