mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-02 15:37:18 +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):
|
||||
return {
|
||||
**context,
|
||||
**self.context,
|
||||
'object': obj,
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ class ObjectAttributesPanel(ObjectPanel, metaclass=ObjectAttributesPanelMeta):
|
||||
'attrs': [
|
||||
{
|
||||
'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
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user