Change permission selection to checkboxes and make the space bigger #8852

Closed
opened 2025-12-29 20:42:06 +01:00 by adam · 22 comments
Owner

Originally created by @gdprdatasubect on GitHub (Nov 18, 2023).

NetBox version

v3.6.5

Feature type

Change to existing functionality

Proposed functionality

Currently the selection for permissions looks like this:
grafik

This does not seem like a good design choice (A lot of options crammed in a small field, ctrl required to add things to selection) and could IMHO better be handled with individual checkboxes and not using a selection-field in the first place, e.g.:

grafik

etc.

Use case

Improve admin-user-experience, not having to press control to add things to the selection, improving accessibility due to being able to use tab to switch to next field

Database changes

No response

External dependencies

No response

Originally created by @gdprdatasubect on GitHub (Nov 18, 2023). ### NetBox version v3.6.5 ### Feature type Change to existing functionality ### Proposed functionality Currently the selection for permissions looks like this: ![grafik](https://github.com/netbox-community/netbox/assets/101808236/9cf79ea2-f800-489f-99b0-08bf57ac7568) This does not seem like a good design choice (A lot of options crammed in a small field, ctrl required to add things to selection) and could IMHO better be handled with individual checkboxes and not using a selection-field in the first place, e.g.: ![grafik](https://github.com/netbox-community/netbox/assets/101808236/5cc26971-293e-4c82-953b-7af3a6d4f0cc) etc. ### Use case Improve admin-user-experience, not having to press control to add things to the selection, improving accessibility due to being able to use tab to switch to next field ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 20:42:06 +01:00
adam closed this issue 2025-12-29 20:42:06 +01:00
Author
Owner

@jonasnieberle commented on GitHub (Dec 19, 2023):

I think it would be very useful if you implement this feature. I struggled the last 15 minutes to select 10 object types. You have to press the Strg key and then scroll down ... then you select the next one and all previous selected object types are deselected.

@jonasnieberle commented on GitHub (Dec 19, 2023): I think it would be very useful if you implement this feature. I struggled the last 15 minutes to select 10 object types. You have to press the Strg key and then scroll down ... then you select the next one and all previous selected object types are deselected.
Author
Owner

@DanSheps commented on GitHub (Dec 20, 2023):

Sorry, this is non-viable straight out of the gate. We have over 100 models within NetBox that can have permissions assigned to them. We cannot generate 100+ check boxes to allow for this.

Additionally, this also doesn't take into account permissions added by plugins.

@DanSheps commented on GitHub (Dec 20, 2023): Sorry, this is non-viable straight out of the gate. We have over 100 models within NetBox that can have permissions assigned to them. We cannot generate 100+ check boxes to allow for this. Additionally, this also doesn't take into account permissions added by plugins.
Author
Owner

@jsenecal commented on GitHub (Dec 20, 2023):

I think it would be very useful if you implement this feature. I struggled the last 15 minutes to select 10 object types. You have to press the Strg key and then scroll down ... then you select the next one and all previous selected object types are deselected.

Maybe the help text could be more explicit and the widget made bigger, but the current way really is the only logical way.

@jsenecal commented on GitHub (Dec 20, 2023): > I think it would be very useful if you implement this feature. I struggled the last 15 minutes to select 10 object types. You have to press the Strg key and then scroll down ... then you select the next one and all previous selected object types are deselected. Maybe the help text could be more explicit and the widget made bigger, but the current way really is the only logical way.
Author
Owner

@jonasnieberle commented on GitHub (Dec 20, 2023):

Ok, yeah you're right 100+ check boxes aren't good to handle. An what about the same method like the filter methods:

image

You can search for the object and can select it and then you see the selected object in the top line. And with the x you can remove the object from the selection. The same ui style is implemented by the user group assignment and the permissions.

image

So we also have the benefit that the same ui styles used 🤔

@jonasnieberle commented on GitHub (Dec 20, 2023): Ok, yeah you're right 100+ check boxes aren't good to handle. An what about the same method like the filter methods: ![image](https://github.com/netbox-community/netbox/assets/100405740/ece6fd29-9cfb-4144-b92e-7a0a8df666bd) You can search for the object and can select it and then you see the selected object in the top line. And with the x you can remove the object from the selection. The same ui style is implemented by the user group assignment and the permissions. ![image](https://github.com/netbox-community/netbox/assets/100405740/786a2c4c-255d-4716-bc50-d5c08f1bd4b2) So we also have the benefit that the same ui styles used 🤔
Author
Owner

@jsenecal commented on GitHub (Dec 20, 2023):

You can search for the object and can select it and then you see the selected object in the top line. And with the x you can remove the object from the selection. The same ui style is implemented by the user group assignment and the permissions.

What do you do when you get 90+ permissions selected ? Wouldnt that break UX ?

@jsenecal commented on GitHub (Dec 20, 2023): > You can search for the object and can select it and then you see the selected object in the top line. And with the x you can remove the object from the selection. The same ui style is implemented by the user group assignment and the permissions. What do you do when you get 90+ permissions selected ? Wouldnt that break UX ?
Author
Owner

@abhi1693 commented on GitHub (Dec 20, 2023):

How about something similar to this?

image

@abhi1693 commented on GitHub (Dec 20, 2023): How about something similar to this? ![image](https://github.com/netbox-community/netbox/assets/5083532/ab3a294c-afc2-4fbb-b737-89a255f85a1e)
Author
Owner

@DanSheps commented on GitHub (Dec 20, 2023):

I think #13435 brings up using a dynamic selector (not clear about it from the description IMO though).

@DanSheps commented on GitHub (Dec 20, 2023): I think #13435 brings up using a dynamic selector (not clear about it from the description IMO though).
Author
Owner

@gdprdatasubect commented on GitHub (Dec 20, 2023):

Ok, yeah you're right 100+ check boxes aren't good to handle

Well, to me the current workflow seems worse to handle than checkboxes, so that's why i suggested them.

Personally I think the whole permission workflow is counterintuitive and the ideal solution would be a Permission Constraint text field per available option, since filtering could be more fine grained and would involve creating less groups (or maybe i'm just using it wrongly)

@gdprdatasubect commented on GitHub (Dec 20, 2023): > Ok, yeah you're right 100+ check boxes aren't good to handle Well, to me the current workflow seems worse to handle than checkboxes, so that's why i suggested them. Personally I think the whole permission workflow is counterintuitive and the ideal solution would be a Permission Constraint text field per available option, since filtering could be more fine grained and would involve creating less groups (or maybe i'm just using it wrongly)
Author
Owner

@DanSheps commented on GitHub (Dec 20, 2023):

Well, to me the current workflow seems worse to handle than checkboxes, so that's why i suggested them.

Try checking 100 checkboxes because you need to give every permission except for a few (compared to Ctrl-A then Ctrl-click on ones you don't need)

Personally I think the whole permission workflow is counterintuitive and the ideal solution would be a Permission Constraint text field per available option, since filtering could be more fine grained and would involve creating less groups (or maybe i'm just using it wrongly)

There is a permission constraint field, but not everyone can be bothered to learn JSON or they have simpler needs.

Additionally, not every model has every field so you typically have to create multiple permissions for permission constraints anyways.

@DanSheps commented on GitHub (Dec 20, 2023): > Well, to me the current workflow seems worse to handle than checkboxes, so that's why i suggested them. Try checking 100 checkboxes because you need to give every permission except for a few (compared to Ctrl-A then Ctrl-click on ones you don't need) > Personally I think the whole permission workflow is counterintuitive and the ideal solution would be a Permission Constraint text field per available option, since filtering could be more fine grained and would involve creating less groups (or maybe i'm just using it wrongly) There is a permission constraint field, but not everyone can be bothered to learn JSON or they have simpler needs. Additionally, not every model has every field so you typically have to create multiple permissions for permission constraints anyways.
Author
Owner

@jeffgdotorg commented on GitHub (Dec 20, 2023):

Checkboxes feel untenable, but we could change this control to use a dynamic multi-select widget. That would make it work like the Content Types control from the existing Add Custom Link flow, giving type-to-filter and removing the need to hold down Ctrl / Strg.

image
@jeffgdotorg commented on GitHub (Dec 20, 2023): Checkboxes feel untenable, but we could change this control to use a dynamic multi-select widget. That would make it work like the _Content Types_ control from the existing _Add Custom Link_ flow, giving type-to-filter and removing the need to hold down Ctrl / Strg. <img width="772" alt="image" src="https://github.com/netbox-community/netbox/assets/1209268/e27d1063-c1de-40e0-a220-4e1707394200">
Author
Owner

@jeffgdotorg commented on GitHub (Dec 20, 2023):

Folding #13435 into this issue. The two are similar enough that we think a common approach (dynamic multi-select, see above) will do the trick for both.

@jeffgdotorg commented on GitHub (Dec 20, 2023): Folding #13435 into this issue. The two are similar enough that we think a common approach (dynamic multi-select, see above) will do the trick for both.
Author
Owner

@DanSheps commented on GitHub (Dec 21, 2023):

Folding #13435 into this issue. The two are similar enough that we think a common approach (dynamic multi-select, see above) will do the trick for both.

It might be a good idea to maybe make it a DynamicModelMultipleChoiceField and see if we can get a selector widget working with it (also make the selector widget work with multi-selection by allowing Ctrl+click to select multiple items).

There would be a little work involved if we wanted to go that route. We would likely need to make ContentType a proxy model of it's own.

@DanSheps commented on GitHub (Dec 21, 2023): > Folding #13435 into this issue. The two are similar enough that we think a common approach (dynamic multi-select, see above) will do the trick for both. It might be a good idea to maybe make it a DynamicModelMultipleChoiceField and see if we can get a selector widget working with it (also make the selector widget work with multi-selection by allowing Ctrl+click to select multiple items). There would be a little work involved if we wanted to go that route. We would likely need to make ContentType a proxy model of it's own.
Author
Owner

@DanSheps commented on GitHub (Jan 9, 2024):

Did we ever decide on which field we should use for this? I am kind of coming around to @abhi1693's idea as any other could get rather messy with the amount of objects we have.

@DanSheps commented on GitHub (Jan 9, 2024): Did we ever decide on which field we should use for this? I am kind of coming around to @abhi1693's idea as any other could get rather messy with the amount of objects we have.
Author
Owner

@github-actions[bot] commented on GitHub (May 15, 2024):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (May 15, 2024): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jonasnieberle commented on GitHub (May 15, 2024):

Did we ever decide on which field we should use for this? I am kind of coming around to @abhi1693's idea as any other could get rather messy with the amount of objects we have.

How can we procceed with this topic? From my site the idea from @abhi1693 ist the best? The other fields can/will break the UI if you select 100+ permissions. Or maybe some other ideas from other software?

@jonasnieberle commented on GitHub (May 15, 2024): > Did we ever decide on which field we should use for this? I am kind of coming around to @abhi1693's idea as any other could get rather messy with the amount of objects we have. How can we procceed with this topic? From my site the idea from @abhi1693 ist the best? The other fields can/will break the UI if you select 100+ permissions. Or maybe some other ideas from other software?
Author
Owner

@jeremystretch commented on GitHub (May 15, 2024):

@JonasEinfach this issue needs a volunteer to implement it. Would you like to own it?

@jeremystretch commented on GitHub (May 15, 2024): @JonasEinfach this issue needs a volunteer to implement it. Would you like to own it?
Author
Owner

@jonasnieberle commented on GitHub (May 15, 2024):

@jeremystretch Im not familar with developing in netbox, but I can try :)

At first look, it looks like that's only a change in the forms of the permission object.

@jonasnieberle commented on GitHub (May 15, 2024): @jeremystretch Im not familar with developing in netbox, but I can try :) At first look, it looks like that's only a change in the forms of the permission object.
Author
Owner

@jonasnieberle commented on GitHub (May 26, 2024):

Today I checked the forms.py for the ObjectPermission.

So that's the actual python code:

    object_types = ContentTypeMultipleChoiceField(
        label=_('Object types'),
        queryset=ObjectType.objects.all(),
        limit_choices_to=OBJECTPERMISSION_OBJECT_TYPES,
        widget=forms.SelectMultiple(attrs={'size': 6})
    )

If Im right you limit the choice of form rendering with the constants OBJECTPERMISSION_OBJECT_TYPES?

In the form we use the ContentTypeMultipleChoiceField. I searched in the netbox github for all forms which use this form as well. For example I found that the CustomFieldForm also use this form.
103c08c2d2/netbox/extras/forms/model_forms.py (L42)

The funny thing - in the custom field form we have definitely a better UI form to select / search / remove / see the content types.

image

But the ObjectPermission Form have the "not well to handle" Form :D

image

The widget attribute forms.SelectMultiple(attrs={'size': 6}) overwrite the default form ...
I commented the widget attribute and we have the better multiple select form.

image

The form can also handle >80 selected objects.
Tbh who use permissions with more than 80 content type objects? It's definitley smarter to use multiple permissions and assign them to a group ...

image

From my site the UI experience is definitely better without widget attribute forms.SelectMultiple(attrs={'size': 6})

What do you think? @jeremystretch @DanSheps

@jonasnieberle commented on GitHub (May 26, 2024): Today I checked the forms.py for the ObjectPermission. So that's the actual python code: ``` object_types = ContentTypeMultipleChoiceField( label=_('Object types'), queryset=ObjectType.objects.all(), limit_choices_to=OBJECTPERMISSION_OBJECT_TYPES, widget=forms.SelectMultiple(attrs={'size': 6}) ) ``` If Im right you limit the choice of form rendering with the constants OBJECTPERMISSION_OBJECT_TYPES? In the form we use the ContentTypeMultipleChoiceField. I searched in the netbox github for all forms which use this form as well. For example I found that the CustomFieldForm also use this form. https://github.com/netbox-community/netbox/blob/103c08c2d2bc3e32d8274b8d8ec8dd2380857388/netbox/extras/forms/model_forms.py#L42 The funny thing - in the custom field form we have definitely a better UI form to select / search / remove / see the content types. ![image](https://github.com/netbox-community/netbox/assets/100405740/2bd42840-fcd7-4dee-8c10-4f35d5d59a36) But the ObjectPermission Form have the "not well to handle" Form :D ![image](https://github.com/netbox-community/netbox/assets/100405740/04f88744-5733-47a5-8096-f1e5f3b5dcf0) The widget attribute _**forms.SelectMultiple(attrs={'size': 6})**_ overwrite the default form ... I commented the widget attribute and we have the better multiple select form. ![image](https://github.com/netbox-community/netbox/assets/100405740/6e5adea2-55e3-450f-a45f-30728727007c) The form can also handle >80 selected objects. Tbh who use permissions with more than 80 content type objects? It's definitley smarter to use multiple permissions and assign them to a group ... ![image](https://github.com/netbox-community/netbox/assets/100405740/02f7eb85-79f2-4ce8-9b48-cc0a1fa3be53) From my site the UI experience is definitely better without widget attribute _**forms.SelectMultiple(attrs={'size': 6})**_ What do you think? @jeremystretch @DanSheps
Author
Owner

@PieterL75 commented on GitHub (Oct 21, 2024):

Cant his FR also include the list view of the user permissions ?
Its a pretty long page when all but some objects are selected
image

Maybe do the same as ip/vlans on interfaces, just display a nbr of there are more than 5

@PieterL75 commented on GitHub (Oct 21, 2024): Cant his FR also include the list view of the user permissions ? Its a pretty long page when all but some objects are selected ![image](https://github.com/user-attachments/assets/80d97d6f-6df7-4842-9824-87559bd6be5d) Maybe do the same as ip/vlans on interfaces, just display a nbr of there are more than 5
Author
Owner

@itslychee commented on GitHub (Jan 29, 2025):

Hey was wondering if there was any update on this!

@DanSheps

Sorry, this is non-viable straight out of the gate. We have over 100 models within NetBox that can have permissions assigned to them. We cannot generate 100+ check boxes to allow for this.

Could you elaborate on this? How does adding another element to each item added to the list of entries and iterating over that to see if an entry is checked not viable? Genuinely just curious

I'd say the solution proposed by @jonasnieberle is probably the cleanest and best solution for this, but hoping there could be some feedback from a member.

thank you for netbox!

@itslychee commented on GitHub (Jan 29, 2025): Hey was wondering if there was any update on this! @DanSheps > Sorry, this is non-viable straight out of the gate. We have over 100 models within NetBox that can have permissions assigned to them. We cannot generate 100+ check boxes to allow for this. Could you elaborate on this? How does adding another element to each item added to the list of entries and iterating over that to see if an entry is checked not viable? Genuinely just curious I'd say the solution proposed by @jonasnieberle is probably the cleanest and best solution for this, but hoping there could be some feedback from a member. thank you for netbox!
Author
Owner

@Omripresent commented on GitHub (May 14, 2025):

Sorry I'm late to the game here with this comment but I've noticed over time when new object models are added we always have to explicitly add them to every relevant permission object.

Assuming you organize your permissions by the app, for example dcim.ro and dcim.rw and so on. You have to keep track on changes and modify those accordingly.

It might be possible to approach the permissions in a hierarchical way by allowing the selection of all models under a certain app (dcim, ipam, core, etc) and automatically account for all related models.
For a more granular control open up the individual models for selection forgoing the app level auto select for that app.

This should allow for a more intuitive control and permission view in most use cases and still allow the fine grained controls of the current setup.

To @PieterL75's comment we should be getting a cleaner view here on the object type from:

Image

To something like

Image

@Omripresent commented on GitHub (May 14, 2025): Sorry I'm late to the game here with this comment but I've noticed over time when new object models are added we always have to explicitly add them to every relevant permission object. Assuming you organize your permissions by the app, for example `dcim.ro` and `dcim.rw` and so on. You have to keep track on changes and modify those accordingly. It might be possible to approach the permissions in a hierarchical way by allowing the selection of all models under a certain app (dcim, ipam, core, etc) and automatically account for all related models. For a more granular control open up the individual models for selection forgoing the app level auto select for that app. This should allow for a more intuitive control and permission view in most use cases and still allow the fine grained controls of the current setup. To @PieterL75's comment we should be getting a cleaner view here on the object type from: ![Image](https://github.com/user-attachments/assets/9bac72db-ee81-47f4-adcc-b3f11e770495) To something like ![Image](https://github.com/user-attachments/assets/2c5ab7f2-d5a9-4a4a-9110-84d8709ea75e)
Author
Owner

@jeremystretch commented on GitHub (Jul 28, 2025):

Closing this in favor of the dual-column approach currently in use for table config and suggested above. Please see FR #19968.

@jeremystretch commented on GitHub (Jul 28, 2025): Closing this in favor of the dual-column approach currently in use for table config and suggested above. Please see FR #19968.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8852