How to check correctly if a user has membership in a group in the specified location in a vault and all its sub-folders using SWPDM API

Hello, I have the following question\problem implementing the following with SWPDM API (2019sp4):

There is a need to check if a user is a member of specified group in a defined location in a vault and all its sub-folders when the custom add-in is triggered by a user (RMB) - please see screenshot attached. 

I am using 'GetGroupMembershipsInFolder Method (IEdmUser9)'

In my C# solution the method returns a value not equal to NULL only if the triggered file is exactly in the specified folder - the '_Default3_\_TESTS\' for 'AlexV' user in the screenshot. In case of sub-folders of the defined location the returned value is NULL. However, when defining the membership in folder in fact the user has membership in all sub-folders of the defined top folder working in the vault.

Please advise how to achieve the desired and to check correctly if the user has membership in a group in the specified location in a vault and all its sub-folders.

See the following example from help (C#):
https://help.solidworks.com/2019/english/api/epdmapi/Add_and_Remove_User_and_Group_from_Folder_Example_CSharp.htm

SolidworksApi/macros