掲示板

Fetching threads with view permission only

9年前 に santhosh Venugopal によって更新されました。

Fetching threads with view permission only

New Member 投稿: 2 参加年月日: 14/05/23 最新の投稿
I am working on requirement where I have to display latest discussion topics..
I have achieved the same like below..

List<MBThread> threadsList = MBThreadLocalServiceUtil.getGroupThreads(lPortletGroupId, 0, WorkflowConstants.STATUS_APPROVED, false, true, -1, -1);
for(MBThread thread : threadsList){
MBThread lTempThread = MBThreadLocalServiceUtil.getThread(thread.getThreadId());
MBMessage message = MBMessageServiceUtil.getMessage(lTempThread.getRootMessageId());//exception occurs here..
String subject = message.getSubject();
//Display topics..
}

However when certain threads are locked(for guest user), I get PrincipalException.

Permission check like below always returns false.
boolean hasPerm = permissionChecker.hasPermission(lPortletGroupId, MBThread.class.getName(),thread.getRootMessageId(), ActionKeys.VIEW);

However the same permission check with MBcategories works fine..I need to get threads with view permission only..Where am I going wrong?.Please help..
thumbnail
9年前 に Shinn Lok によって更新されました。

RE: Fetching threads with view permission only

Junior Member 投稿: 89 参加年月日: 11/01/14 最新の投稿
I think calling MBThreadServiceUtil.getGroupThreads instead of the LocalService gets what you want?