Skip to content
This repository was archived by the owner on Jun 27, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions netbox_plugin_azuread/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def _configure_access_groups(self, user, access_token):
azure_group_names = [entry.get('displayName') for entry in azure_groups]
AD_GROUP_MAP = PLUGIN_SETTINGS.get('AD_GROUP_MAP', {})
for group_name in azure_group_names:
if group_name not in PLUGIN_SETTINGS['AD_GROUP_FILTER']:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would first check if PLUGIN_SETTINGS['AD_GROUP_FILTER'] is defined. I can imagine AD_GROUP_FILTER being initialised as an empty list and then for users who upgrade but don't define a filter, suddenly all groups are filtered out because nothing is in the filter list!

LOGGER.debug(f"Skip create group {group_name}")
continue
group, _ = Group.objects.get_or_create(
name=group_name
)
Expand Down