留言板
Permission Checker not Initialized !! Liferay 6
Hakan Görmüş,修改在13 年前。
Permission Checker not Initialized !! Liferay 6
New Member 帖子: 3 加入日期: 10-8-20 最近的帖子
Hi all,
i am tring to get folder with DlFolderService. Tring like below ;
But i am getting ;
I looked the source code ;
There is a permission check but how can i initialize PermissionChecker ??? Any idea ?
i am tring to get folder with DlFolderService. Tring like below ;
DLFolderService folderService = DLFolderServiceUtil.getService();
DLFolder folder = folderService.getFolder(folderPrimeryKeyId);
But i am getting ;
com.liferay.security.auth.PrincipalException : PermissionChecker not initialized
at
com.liferay.portal.services.base.PrincipalBean.getPermissionChecker(PrincipalBean.java:81)
at com.liferay.portlet.documentlibrary.service.impl.DLFolderServiceImpl.getFolder(DLFolderServiceImpl.java:166)...
I looked the source code ;
public DLFolder getFolder(long folderId)
throws PortalException, SystemException {
DLFolder folder = dlFolderLocalService.getFolder(folderId);
DLFolderPermission.check(
getPermissionChecker(), folder, ActionKeys.VIEW);
return folder;
}
There is a permission check but how can i initialize PermissionChecker ??? Any idea ?
Alexander Gonzalez Castañeda,修改在6 年前。
RE: Permission Checker not Initialized !! Liferay 6
New Member 发布: 1 加入日期: 17-2-27 最近的帖子
Hi
I'm having the same problemn...
Please tell me if you solved this issue?
I'm having the same problemn...
Please tell me if you solved this issue?
Christoph Rabel,修改在6 年前。
RE: Permission Checker not Initialized !! Liferay 6
Liferay Legend 帖子: 1554 加入日期: 09-9-24 最近的帖子
*LocalService -> No permission checks
*Service -> Permission checks
You probably want to use DLFolderLocalService.
Usually the permissionchecker is initialized with the current user. So, you can simply assume, it's there. That's not true in some cases, e.g. when a scheduled job is started.
*Service -> Permission checks
You probably want to use DLFolderLocalService.
Usually the permissionchecker is initialized with the current user. So, you can simply assume, it's there. That's not true in some cases, e.g. when a scheduled job is started.