Skip to content

is_user_admin function in new Rhino-8 .NET 7 #321

@ed-p-may

Description

@ed-p-may

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.

  1. 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).
    Screenshot 2024-01-09 at 10 11 48 AM

  2. Also, I think this function should return False in the except block. The docstring states it returns a boolean, not a boolean | None

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions