UserIsAdmin is missed in TFS2017

The UserIsAdmin cannot be found on the TeamContext object result. According to the test in my machine, it could be got in TFS2015 but could not got in TFS2017. For more detailed, you could refer to the following link:

Solutions

So there is a way for you to get this data inside of an extension. You can use the security client to see if the current user has the manage permission for the team. If they have this permssion, then they are team admins. In the sample below, the hasPermissions function takes 3 parameters. The first is the security namespace the permission exists in. The second parameter is the permission we want to check. In this case 8 corresponds to the manage permssion. The third parameter is the security token to check. This is in the format of projectId\teamId. We will look at moving the security namespace and permission values into a constants file so you do not have to hardcode these values. But for now, this should unblock you. This is code I was using in a sample extension.

VSS.ready(function () {
VSS.require(["VSS/Service", "VSS/Security/RestClient"],
function (VSS_Service, SecurityClient) {
var context = VSS.getWebContext();
var security_http_client = VSS_Service.VssConnection.getConnection(context).getHttpClient(SecurityClient.SecurityHttpClient);
security_http_client.hasPermissions("5a27515b-ccd7-42c9-84f1-54c998f03866", 8, context.project.id+"\\"+context.team.id).then(function(permissions){
// An array of permissions for the checked tokens. This sample is only passing the one token to check so
// this will only have one value in the array.
alert(permissions[0]);
});
});
VSS.notifyLoadSucceeded();
});