Hi @chriswmackey , @mostaphaRoudsari , I am running into a few issues with the ladybug_rhino.is_user_admin() function in the new .NET 7 in Rhino 8 I wanted to flag.
-
This function does not seem to work as explained in the function's comments? On my machine, in Rhino 7, even when the user is NOT admin, those methods called do exist (contrary to the comment there on line 135).

-
Also, I think this function should return False in the except block. The docstring states it returns a boolean, not a boolean | None
-
In .NET 7 and Rhino 8, it does not appear (on my machine at least) that the property "WindowsPrincipal" exists any longer? When I query the System.Security.Principal in Rhino 8 I now see only:
['GenericIdentity', 'GenericPrincipal', 'IIdentity', 'IPrincipal', 'PrincipalPolicy', 'TokenImpersonationLevel']
I can verify Rhino 8 is in 'As-Admin' mode in 'Taskmanager' checking the 'Elevated' process status.
Do you have any thoughts on how to resolve this change in Rhino 8? Perhaps there is some new / other way to check 'is-admin' now in .NET 7? For reference, I have cross-posted this issue to the Mcneel discourse as well.
Hi @chriswmackey , @mostaphaRoudsari , I am running into a few issues with the
ladybug_rhino.is_user_admin()function in the new .NET 7 in Rhino 8 I wanted to flag.This function does not seem to work as explained in the function's comments? On my machine, in Rhino 7, even when the user is NOT admin, those methods called do exist (contrary to the comment there on line 135).

Also, I think this function should
return Falsein theexceptblock. The docstring states it returns a boolean, not aboolean | NoneIn .NET 7 and Rhino 8, it does not appear (on my machine at least) that the property "WindowsPrincipal" exists any longer? When I query the
System.Security.Principalin Rhino 8 I now see only:['GenericIdentity', 'GenericPrincipal', 'IIdentity', 'IPrincipal', 'PrincipalPolicy', 'TokenImpersonationLevel']I can verify Rhino 8 is in 'As-Admin' mode in 'Taskmanager' checking the 'Elevated' process status.
Do you have any thoughts on how to resolve this change in Rhino 8? Perhaps there is some new / other way to check 'is-admin' now in .NET 7? For reference, I have cross-posted this issue to the Mcneel discourse as well.