Permissions – Custom Navigation bypasses SharePoint Group and uses AD Groups

I have a custom SharePoint 2016 on Prem navigation with links that only certain people can see. I'm currently using an SP group and updating it manually when a new employee is hired with their AD account. I want to bypass the SP group and use AD groups so I do not have to update manually anymore. Hope that makes sense. Below is my code for reading from the SP group.

var allowedGroups = [“IT”];
var isInAllowedGroup = false;

var userid = _spPageContextInfo.userId;
var requestUri = _spPageContextInfo.webAbsoluteUrl + & # 39; / _api / web / CurrentUser / Groups? $ select = Id, Title & # 39 ;;

// alert (requestUri);
var requestHeaders = {"accept": "application / json; odata = verbose"};
$ .ajax ({
URL: requestUri,
contentType: "application / json; odata = verbose",
Header: requestHeaders,
Success: onSuccess,
Error: onError
});

Function onSuccess (data, request) {
var s = & # 39; & # 39 ;;
for (var i = 0; i <data.d.results.length; i ++)
{
s + = data.d.results[i]Title + # 39; & # 39 ;;

var groupName = data.d.results[i].Title;
if (allowedGroups.indexOf (groupName)> -1)
{
isInAllowedGroup = true;
}
}

if (isInAllowedGroup) {
$ ("# IT"). Css (& # 39; display & # 39 ;, block & # 39;);
}

    (S);

}
Function onError (error) {
( "Error");
}

});

Thanks in advance.