1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

20 Commits

Author SHA1 Message Date
a4acb50edd 12589 move user and group admin from admin (#12877)
Move admin views for users, groups, and object permissions from the admin site to the NetBox frontend

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-20 16:22:08 -04:00
d470848b29 Closes #12246: General cleanup of utilities modules
* Clean up base modules

* Clean up forms modules

* Clean up templatetags modules

* Replace custom simplify_decimal filter with floatformat

* Misc cleanup

* Merge ReturnURLForm into ConfirmationForm

* Clean up import statements for utilities.forms

* Fix field class references in docs
2023-04-14 10:33:53 -04:00
9628dead07 Closes #10560: New global search (#10676)
* Initial work on new search backend

* Clean up search backends

* Return only the most relevant result per object

* Clear any pre-existing cached entries on cache()

* #6003: Implement global search functionality for custom field values

* Tweak field weights & document guidance

* Extend search() to accept a lookup type

* Move get_registry() out of SearchBackend

* Enforce object permissions when returning search results

* Add indexers for remaining models

* Avoid calling remove() on non-cacheable objects

* Use new search backend by default

* Extend search backend to filter by object type

* Clean up search view form

* Enable specifying lookup logic

* Add indexes for value field

* Remove object type selector from search bar

* Introduce SearchTable and enable HTMX for results

* Enable pagination

* Remove legacy search backend

* Cleanup

* Use a UUID for CachedValue primary key

* Refactoring search methods

* Define max search results limit

* Extend reindex command to support specifying particular models

* Add clear() and size to SearchBackend

* Optimize bulk caching performance

* Highlight matched portion of field value

* Performance improvements for reindexing

* Started on search tests

* Cleanup & docs

* Documentation updates

* Clean up SearchIndex

* Flatten search registry to register by app_label.model_name

* Clean up search backend classes

* Clean up RestrictedGenericForeignKey and RestrictedPrefetch

* Resolve migrations conflict
2022-10-21 13:16:16 -04:00
12c138b341 Closes #9074: Enable referencing the current user when evaluating permission constraints 2022-07-01 13:34:10 -04:00
c6dfdf10e5 Introduce qs_filter_from_constraints() for constructing object permission QS filters 2022-07-01 11:49:36 -04:00
90257e9dee Fixes #8715: eliminates duplicates when used in many-to-many field constraints
When using permissions that use tags, a user may receive multiple permissions
of the same type if multiple tags are assigned to the device. This causes the
RestrictedQuerySet class to generate a query similar to this:

>>> dcim.models.Device.objects.filter(Q(tags__name='tag1')|Q(tags__name='tag2'))
<ConfigContextModelQuerySet [<Device: device1>, <Device: device1>]>

This query returns the same object twice if both tags are assigned to it. This
is due to the use of the django-taggit library. The library's documentation
describes this behavior as expected and suggests using an explicit distinct()
call in queries to avoid duplicates.

However, the use of DISTINCT in queries has a global side effect -
deduplication of responses, which may or may not be acceptable behavior
(depending on further use). Since it is not known how RestrictedQuerySet will
be used in the rest of the code, it was decided to dedupe using a subquery.
2022-03-04 14:37:05 +07:00
4ee8e473eb Move ObjectChange creation into signal receivers 2020-08-14 17:03:45 -04:00
4a516103a6 Extend ObjectPermission constraints to OR multiple JSON objects 2020-08-06 15:53:23 -04:00
cb36f9fdb3 Remove restriction enforcement from RestrictedQuerySet 2020-07-23 12:48:03 -04:00
9777f25b9f Set the default action to 'view' for restrict() 2020-06-26 11:57:07 -04:00
2d4694e72d Merge pull request #4770 from netbox-community/3703-limit-tag-creation
Closes #3703: Restrict tag creation
2020-06-17 12:28:04 -04:00
54ece346bc DummyQuerySet should be iterable to allow for serialization 2020-06-17 12:20:56 -04:00
ffb43a8534 Introduce unrestricted() method on RestrictedQuerySet 2020-06-16 12:20:21 -04:00
ce5fd7955f Catch and log evaluation of RestrictedQuerySet without calling restrict() 2020-06-16 10:39:15 -04:00
3a9512f086 Refine queryset restriction logic 2020-06-01 13:09:34 -04:00
3c334a0238 Update views to restrict all querysets 2020-06-01 11:43:49 -04:00
5574aaa8cb Tweak restrict() to accept only an action keyword 2020-06-01 10:45:49 -04:00
e23b2c4c4f Implement RestrictedQuerySet as a manager 2020-05-29 16:27:36 -04:00
5b6a6fb63e Move restrict_queryset() function to RestrictedQuerySet 2020-05-29 15:09:08 -04:00
ccb9f7bfe2 Rewrote ObjectChangeMiddleware to remove the curried handle_deleted_object() function 2019-10-22 15:10:49 -04:00