-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.2.X, Master
-
Fix Version/s: 7.2.X, 7.3.10 DXP FP1, 7.3.10.1 DXP SP1, 7.3.6 CE GA7, 7.3.X, 7.4.13 DXP GA1, Master
-
Component/s: Core Infrastructure > Permissions
-
Branch Version/s:7.3.x, 7.2.x
-
Backported to Branch:Committed
-
Fix Priority:3
-
Sprint:Iteration 49
-
Git Pull Request:
Reproduction steps:
- Create a new user "user1"
- Replace the groupId in the attached Groovy script test.groovy
import java.util.ArrayList; import com.liferay.journal.service.JournalArticleServiceUtil; import com.liferay.portal.kernel.model.User; import com.liferay.portal.kernel.security.auth.CompanyThreadLocal; import com.liferay.portal.kernel.security.permission.PermissionChecker; import com.liferay.portal.kernel.security.permission.PermissionCheckerFactoryUtil; import com.liferay.portal.kernel.security.permission.PermissionThreadLocal; import com.liferay.portal.kernel.service.UserLocalServiceUtil; long groupId = <<INSERT GROUP ID HERE>>; long companyId = CompanyThreadLocal.getCompanyId(); User user1 = UserLocalServiceUtil.getUserByScreenName(companyId, "user1"); PermissionChecker checker = PermissionCheckerFactoryUtil.create(user1); PermissionThreadLocal.setPermissionChecker(checker); try { JournalArticleServiceUtil.search( companyId, groupId, new ArrayList<Long>(), 0, null, null, null, null, "asdfgh", "BASIC-WEB-CONTENT", "BASIC-WEB-CONTENT", null, null, 0, null, true, -1, -1, null); } catch(Exception ex) { out.println("ERROR:"); ex.printStackTrace(out); }
- Run the script at Control Panel→Configuration→Server Administration→Script→copy-paste→Execute
Expected behaviour: No error is shown in the output
Actual behaviour: SQL error is shown in the output