You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/additional-features/custom-scripts.md
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,18 @@ The checkbox to commit database changes when executing a script is checked by de
71
71
commit_default = False
72
72
```
73
73
74
+
## Accessing Request Data
75
+
76
+
Details of the current HTTP request (the one being made to execute the script) are available as the instance attribute `self.request`. This can be used to infer, for example, the user executing the script and the client IP address:
self.log_info("Running as user {} (IP: {})...".format(username, ip_address))
82
+
```
83
+
84
+
For a complete list of available request parameters, please see the [Django documentation](https://docs.djangoproject.com/en/stable/ref/request-response/).
85
+
74
86
## Reading Data from Files
75
87
76
88
The Script class provides two convenience methods for reading data from files:
Copy file name to clipboardExpand all lines: docs/installation/4-ldap.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,7 @@ AUTH_LDAP_USER_ATTR_MAP = {
80
80
```
81
81
82
82
# User Groups for Permissions
83
+
83
84
!!! info
84
85
When using Microsoft Active Directory, support for nested groups can be activated by using `NestedGroupOfNamesType()` instead of `GroupOfNamesType()` for `AUTH_LDAP_GROUP_TYPE`. You will also need to modify the import line to use `NestedGroupOfNamesType` instead of `GroupOfNamesType` .
*`is_staff` - Users mapped to this group are enabled for access to the administration tools; this is the equivalent of checking the "staff status" box on a manually created user. This doesn't grant any specific permissions.
118
119
*`is_superuser` - Users mapped to this group will be granted superuser status. Superusers are implicitly granted all permissions.
119
120
121
+
!!! warning
122
+
Authentication will fail if the groups (the distinguished names) do not exist in the LDAP directory.
123
+
120
124
# Troubleshooting LDAP
121
125
122
126
`supervisorctl restart netbox` restarts the Netbox service, and initiates any changes made to `ldap_config.py`. If there are syntax errors present, the NetBox process will not spawn an instance, and errors should be logged to `/var/log/supervisor/`.
0 commit comments