MainServlet中,当处理完全局启动事件,比如插件自动部署目录的设定之后,就开始初始化Resource Action,其代码如下:
if (_log.isDebugEnabled()) { _log.debug("Initialize resource actions"); } try { initResourceActions(portlets); } ..它调用了initResourceActions方法,我们看它做了什么事情:
首先,它对PERMISSIONS_USER_CHECK_ALGORITHM的设定必须是6以上,否则就返回:
if (PropsValues.PERMISSIONS_USER_CHECK_ALGORITHM < 6) { if (_log.isWarnEnabled()) { StringBundler sb = new StringBundler(8); sb.append("Liferay is configured to use permission algorithm "); sb.append(PropsValues.PERMISSIONS_USER_CHECK_ALGORITHM); sb.append(". Versions after 6.1 will only support algorithm "); sb.append("6 and above. Please sign in as an administrator, "); ... _log.warn(sb.toString()); } return; }这个设定在portal.properties文件中,Liferay 6 默认的设置为6:
# # Set the algorithm used to check permissions for a user. This is useful so # that you can optimize the search for different databases. See # com.liferay.portal.service.impl.PermissionLocalServiceImpl. # # Algorithms 1 through 4 are essentially the same but make calls in different # orders depending on how the database is optimized and how the portal # permissions are used. Algorithm 5 moves to a completely role based # permissions check for better performance. Permissions by users are no # longer supported, yet it uses the same table structure as algorithms 1-4. # # Algorithm 6 is the current algorithm for Liferay 6 and above. It supports # role based permissions like algorithm 5, but does so by using only one # table and bitwise operations. This makes it perform far better than the # other algorithms. # #permissions.user.check.algorithm=1 #permissions.user.check.algorithm=2 #permissions.user.check.algorithm=3 #permissions.user.check.algorithm=4 #permissions.user.check.algorithm=5 permissions.user.check.algorithm=6