简体   繁体   English

如何根据 IronPython 中的当前用户在 Spotfire 中“隐藏”选项卡?

[英]How can I 'hide' a tab in Spotfire depending on the current user in IronPython?

I have a tab that contains a visualizations for data validation and testing.我有一个选项卡,其中包含用于数据验证和测试的可视化。 I'd like to leave that tab in there without showing to anyone but the devs.我想把那个标签留在那里,除了开发人员外,不向任何人展示。

I can get the current user this way but can't find how to 'hide' the tab.我可以通过这种方式获取当前用户,但找不到如何“隐藏”选项卡。

from System.Threading import Thread 
print Thread.CurrentPrincipal.Identity.Name 

I'm quite sure that hiding a tab is not possible.我很确定隐藏标签是不可能的。 there are some other possible solutions, though.不过,还有一些其他可能的解决方案。

  1. change the navigation style from Titled Tabs to History Tabs , then handle navigation between pages with a textarea that is populated by your script.将导航样式从Titled Tabs更改为History Tabs ,然后使用由脚本填充的 textarea 处理页面之间的导航。 it's the simplest solution, but if you have super sensitive data in this analysis AND your users are accessing via the Analyst client, then a user could change the navigation style.这是最简单的解决方案,但是如果您在此分析中有超级敏感的数据并且您的用户正在通过 Analyst 客户端访问,那么用户可以更改导航样式。
  2. based on the user group, write a script that creates any pages with visualizations on the fly.根据用户组,编写一个脚本来动态创建任何具有可视化效果的页面。 this one is also at risk to users with Analyst plus scripting access, and is significantly more work to create and maintain (but also really cool and fun, if you like scripting!).对于具有 Analyst 和脚本访问权限的用户来说,这也存在风险,并且需要更多的创建和维护工作(但如果您喜欢脚本,也非常酷和有趣!)。
  3. make a different analysis per "user group".对每个“用户组”进行不同的分析。 probably not the best solution since you'd need to repeat any updates for each analysis.可能不是最佳解决方案,因为您需要为每次分析重复任何更新。 this gives you the most security but I think at the highest long-term cost (assuming that the analyses will change over time).这为您提供了最大的安全性,但我认为长期成本最高(假设分析会随着时间的推移而改变)。

Update for anyone who may be interested:更新给任何可能感兴趣的人:

In spotfire 10+, you can insert some code into a text area to hide tabs in a dashboard page when viewed on the web (this will not hide tabs on the Analyst client):在 spotfire 10+ 中,您可以在文本区域中插入一些代码,以便在 Web 上查看时隐藏仪表盘页面中的选项卡(这不会隐藏 Analyst 客户端上的选项卡):

navigationBar = $("#id10") 
navigationBar.css("display", "none"); 

You can then get fancy with IPython to check the user names and add or remove this code from the text area in real time.然后,您可以使用IPython来实时检查用户名并在文本区域中添加或删除此代码。 That will hide and show tabs based on user names.这将根据用户名隐藏和显示选项卡。

To show the other tabs, you follow option 1 from niko and just create your own navigation using additional HTML/CSS in the text area.要显示其他选项卡,请遵循 niko 的选项 1,只需在文本区域中使用其他HTML/CSS创建自己的导航。

If you are on Spotfire 10.8 or higher you have a more robust solution , you can combine below two IronPython scripts into one which is executed on the load of the analysis.如果您使用的是 Spotfire 10.8 或更高版本,您有更强大的解决方案,您可以将以下两个 IronPython 脚本合并为一个,在分析负载时执行。

1)Get the username or group 2)Hide the page 3)CustomDateTime Fucntion to trigger IP on load of analysis. 1) 获取用户名或组 2) 隐藏页面 3) 自定义日期时间功能在分析加载时触发 IP。

This works for Consumer license Users.这适用于消费者许可证用户。

https://community.tibco.com/wiki/how-fetch-information-about-logged-user-tibco-spotfirer-using-ironpython-script https://community.tibco.com/wiki/how-fetch-information-about-logged-user-tibco-spotfirer-using-ironpython-script

https://community.tibco.com/wiki/how-show-or-hide-pages-consumer-users-viewing-mode-tibco-spotfirer-using-ironpython-script https://community.tibco.com/wiki/how-show-or-hide-pages-consumer-users-viewing-mode-tibco-spotfirer-using-ironpython-script

https://community.tibco.com/wiki/custom-datetime-data-function-tibco-spotfire https://community.tibco.com/wiki/custom-datetime-data-function-tibco-spotfire

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

相关问题 如何使用IronPython模拟当前用户? - How can I impersonate the current user with IronPython? 如何在Spotfire中使用IronPython获取列的外部名称? - How can I get the externalname of a column using IronPython in Spotfire? 如何在Spotfire中使用IronPython设置复选框过滤器? - How can checkbox filter be set with IronPython in Spotfire? 如何使用IronPython脚本(最好使用外部名称)在Spotfire中创建计算列? - How can I create a Calculated Column in Spotfire with IronPython script (preferably using External Name)? Spotfire我可以通过ironpython脚本输入列吗? - Spotfire can i input a column through ironpython script? 如何在Spotfire的IronPython中引用特定的数据表? - How do I refer to a spcific datatable in IronPython in Spotfire? 如何在Spotfire Dashboard加载上运行IronPython脚本 - How to run an IronPython Script on Spotfire Dashboard load 如何使用IronPython在Spotfire中将DataTable转换为JSON? - How to convert a DataTable into JSON in spotfire using IronPython? 我可以使用哪个IronPython编辑器为Tibco Spotfire控件开发脚本 - Which IronPython editor I can use to develop scripts for Tibco Spotfire controls 我在 IronPython、Spotfire 中有一个存储为字符串的列表。 如何以原始列表格式检索它? - I have a list stored as string in IronPython, Spotfire. How do I retrieve it back in the original list format?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM