mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-21 08:21:48 +02:00
Include permissions in TemplatedAttr context
This commit is contained in:
@@ -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,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user