如何防止用户删除Liferay Portlet? [英] How to prevent users from deleting a liferay portlet?
问题描述
我在liferay页面中有一个IFrame portlet. 我想要一些快速修复程序,以防止登录的用户删除该Portlet.可以通过用户角色,css,代码或其他任何方式来完成.这可能吗?
I have an IFrame portlet in a liferay page. I want some quick fix to prevent logged in users from deleting that portlet. It can be done via user roles, css, code, or whatever. Is this possible?
推荐答案
我建议修改您的主题portlet.vm
模板.
如果您快速浏览sevencogs主题,那将非常简单:
I would suggest modifying your themes portlet.vm
template.
It's pretty straight forward, if you take a quick look at the sevencogs theme:
#if ($portlet_display.isShowBackIcon())
<a href="$portlet_back_url" class="portlet-icon-back">#language ("return-to-full-page")</a>
#else
$theme.iconOptions()
$theme.iconMinimize()
$theme.iconMaximize()
$theme.iconClose()
#end
只需删除$theme.iconClose()
,您的用户将无法再关闭/删除portlet.
请注意,这适用于所有 portlet(因为它是模板).
Just remove $theme.iconClose()
and your users won't be able to close/remove portlets anymore.
Note that this applies to all portlets (since its a template).
如果您只想禁用某些Portlet的关闭按钮,我只需使用CSS即可.在类.portlet-close-icon
上执行display: none
,该类由保存iFrame的div继承.
特别是
If you'd like to deactivate the close button for some portlets only, I would simply do it by CSS. Do a display: none
on the class .portlet-close-icon
which is inherited by the div holding the iFrame.
In particular
.portlet-iframe .portlet-close-icon {
display: none;
}
将完成liferay iFrame portlet的工作.
will do the job for the liferay iFrame portlet.
这篇关于如何防止用户删除Liferay Portlet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!