Created
August 18, 2013 15:03
-
-
Save rotty3000/6262084 to your computer and use it in GitHub Desktop.
BaseTemplateManager avoid AccessController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -20,4 +20,5 @@ import com.liferay.portal.kernel.template.TemplateManager; | |
import com.liferay.portal.kernel.template.TemplateResource; | |
+import java.security.AccessControlContext; | |
import java.security.AccessController; | |
import java.security.PrivilegedAction; | |
@@ -50,4 +51,16 @@ public abstract class BaseTemplateManager implements TemplateManager { | |
templateContextHelper.getHelperUtilities(restricted); | |
+ TemplateControlContext templateControlContext = | |
+ templateContextHelper.getTemplateControlContext(); | |
+ | |
+ AccessControlContext accessControlContext = | |
+ templateControlContext.getAccessControlContext(); | |
+ | |
+ if (accessControlContext == null) { | |
+ return doGetTemplate( | |
+ templateResource, errorTemplateResource, restricted, | |
+ helperUtilities); | |
+ } | |
+ | |
return AccessController.doPrivileged( | |
new DoGetTemplatePrivilegedAction( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment