How can I extract the current user from a DataExtender?

I wrote a DataExtender that โ€œhidesโ€ certain elements from the view. The idea is that some elements should not be displayed in any list in the graphical interface, although the user can have access to it (similar to system files / folders in windows that are usually not visible, even if you have the right to read them).

It works fine, but now I want to make an exception for system administrators: they should always see each item. But I do not see how I can extract the current user from my DataExtender. Is it possible? If so, how?

+4
source share
1 answer

You can use Tridion.Web.UI.Core.Utils.GetUserName() to get your Windows username and then create your own Core Service client, call Impersonate, and then call GetCurrentUser.

+4
source

Source: https://habr.com/ru/post/1439998/


All Articles