简体   繁体   English

在不使用核心服务的情况下冒充Tridion 2011

[英]Impersonate in Tridion 2011 without using core service

I'm trying to impersonate a user in a C# TBB. 我试图冒充C#TBB中的用户。 is it possible to know who initiated the publish action of a component in the TBB which is a part of the component template rendering with the component? 是否有可能知道谁在TBB中启动了组件的发布操作,这是组件模板与组件一起呈现的一部分?

As mentioned in below article 如下文所述

http://yatb.mitza.net/2012/05/publishing-from-template-code-using.html http://yatb.mitza.net/2012/05/publishing-from-template-code-using.html

Once you will get the Current Publish transaction you can use the properties .Creator to get the user. 获得Current Publish事务后,您可以使用属性.Creator来获取用户。

To get the Current Publish Transaction you can refer 要获取当前发布交易,您可以参考

http://yatb.mitza.net/2012/05/publishing-from-template-code-using.html http://yatb.mitza.net/2012/05/publishing-from-template-code-using.html

In your TBB you have access to the engine.GetSession() , which returns a Session object, containing the User information, I'm sure via that you can do in your code, what you are trying to achieve. 在您的TBB中,您可以访问engine.GetSession() ,它返回一个包含User信息的Session对象,我相信您可以在代码中执行,您要实现的目标。

It would be interesting to know a little more about what you are trying to archive. 了解您要归档的内容会更有趣。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM