How to get tcmid of currently logged user in Tridion?

前端 未结 2 575
终归单人心
终归单人心 2021-01-29 12:55
    private void Subscribe()
    {
        EventSystem.Subscribe(GetInfo, EventPhases.Initiated);
    }

    public void GetInfo(User user, Lo         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-29 13:31

    If you want to get the TCM URI of the current user, you can do so in a number of ways.

    I would recommend one of these:

    1. Using the Core Service, call GetCurrentUser and read the Id property.
    2. Using TOM.NET, read the User.Id property of the current Session.

    It looks like you want #2 in this case as your code is in the event system.

提交回复
热议问题