spring - Liferay Spring MVC 权限检查器
问题描述
我需要为角色创建自定义权限以显示/隐藏div's
并buttons
取决于用户角色。在 Internet 上,我找不到使用 Spring MVC 4.3.21 对 Liferay 7.1 的自定义权限。
这是一个带有示例的站点:创建自定义权限和显示/隐藏。
问题是我的结构项目与上面的示例不同。
我有一个春季项目。
项目结构:
web.xml
portlet.xml
liferay-portlet.xml
liferay-display.xml
弹簧上下文(文件夹)
- spring-context
portlet-application-context.xml
- portlet:
Employee-portlet.xml
portlet.xml
<portlet>
<portlet-name>Employee</portlet-name>
<display-name>Employee</display-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/spring-context/portlet/Employee-portlet.xml</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>Employee</title>
<short-title>Employee</short-title>
<keywords>Employee</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
员工-portlet.xml
<bean id="portletModeHandlerMapping"
class="org.springframework.web.portlet.handler.PortletModeHandlerMapping">
<property name="portletModeMap">
<map>
<entry key="view">
<ref bean="employeeV## Heading ##iewController" />
</entry>
</map>
</property>
</bean>
解决方案
推荐阅读
- c++ - constexpr 上下文中的 std::optional 赋值运算符
- php - 使用 .htaccess 保护文件夹,但通过成功的 PHP 登录访问它
- php - PHP:返回每个键的数组的最小值
- sequelize.js - 连接表上的高效 GraphQL 查询
- react-native - 来自图像文件的二维码解码器(反应原生)
- javascript - 如何为 Promise.all 参数映射字符串数组?
- javascript - Angular 有类似 window.addEventListener 的功能吗?
- google-sheets - 当 [value if error] 设置为 "" 时,=IFERROR 不返回空单元格
- angular - 管道 shareReplay 与 ReplaySubject.observableOf 的 Observable
- java - UX 中这些“进度圈”设计的正确术语是什么?