|
4 | 4 |
|
5 | 5 | Default: True
|
6 | 6 |
|
7 |
| -If disabled, the values of API tokens will not be displayed after each token's initial creation. A user **must** record the value of a token immediately upon its creation, or it will be lost. Note that this affects _all_ users, regardless of assigned permissions. |
| 7 | +If disabled, the values of API tokens will not be displayed after each token's initial creation. A user **must** record the value of a token prior to its creation, or it will be lost. Note that this affects _all_ users, regardless of assigned permissions. |
8 | 8 |
|
9 | 9 | ---
|
10 | 10 |
|
@@ -90,6 +90,38 @@ CSRF_TRUSTED_ORIGINS = (
|
90 | 90 |
|
91 | 91 | ---
|
92 | 92 |
|
| 93 | +## DEFAULT_PERMISSIONS |
| 94 | + |
| 95 | +!!! info "This parameter was introduced in NetBox v3.6." |
| 96 | + |
| 97 | +Default: |
| 98 | + |
| 99 | +```python |
| 100 | +{ |
| 101 | + 'users.view_token': ({'user': '$user'},), |
| 102 | + 'users.add_token': ({'user': '$user'},), |
| 103 | + 'users.change_token': ({'user': '$user'},), |
| 104 | + 'users.delete_token': ({'user': '$user'},), |
| 105 | +} |
| 106 | +``` |
| 107 | + |
| 108 | +This parameter defines object permissions that are applied automatically to _any_ authenticated user, regardless of what permissions have been defined in the database. By default, this parameter is defined to allow all users to manage their own API tokens, however it can be overriden for any purpose. |
| 109 | + |
| 110 | +For example, to allow all users to create a device role beginning with the word "temp," you could configure the following: |
| 111 | + |
| 112 | +```python |
| 113 | +DEFAULT_PERMISSIONS = { |
| 114 | + 'dcim.add_devicerole': ( |
| 115 | + {'name__startswith': 'temp'}, |
| 116 | + ) |
| 117 | +} |
| 118 | +``` |
| 119 | + |
| 120 | +!!! warning |
| 121 | + Setting a custom value for this parameter will overwrite the default permission mapping shown above. If you want to retain the default mapping, be sure to reproduce it in your custom configuration. |
| 122 | + |
| 123 | +--- |
| 124 | + |
93 | 125 | ## EXEMPT_VIEW_PERMISSIONS
|
94 | 126 |
|
95 | 127 | Default: Empty list
|
|
0 commit comments