Package freemarker.core
Class FreeMarkerPermission
java.lang.Object
java.security.Permission
java.security.BasicPermission
freemarker.core.FreeMarkerPermission
- All Implemented Interfaces:
Serializable,Guard
A class representing all FreeMarker-related permissions. Currently available
permissions are:
| modifyTemplate | Permits invocation of various template methods that can be used to
modify the template in such a way as to breach security. Specifically,
Template.getRootTreeNode(), TemplateCore.getMacros(),
Template.setParent(Configurable), and
Template.containingElements(int, int).
|
| setSecure | Permits invocation of Configuration.setSecure(boolean)
with false argument (thus turning off security of a secure configuration). |
| setScriptEngineConfiguration | Permits invocation of
FreeMarkerScriptEngine.setConfiguration(freemarker.template.Configuration) or specifying a configuration object
within the engine's bindings under name
FreeMarkerScriptConstants.CONFIGURATION. |
| setScriptEngineFactoryConfiguration | Permits invocation of
FreeMarkerScriptEngineFactory.setConfiguration(freemarker.template.Configuration). |
| setTemplateLoader | Permits setting an arbitrary template loader using
Configuration.setTemplateLoader(freemarker.cache.TemplateLoader).
Note that various setXxxForTemplateLoading() methods are not
checked for this permission, as they internally all create trusted
template loaders. |
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckPermission(Configuration config, Permission permission) Checks a permission if there is a SecurityManager installed in the JVM and the Configuration's isSecure() returns true.static voidcheckPermission(Permission permission) Checks a permission if there is a SecurityManager installed in the JVM.Methods inherited from class java.security.BasicPermission
equals, getActions, hashCode, implies, newPermissionCollectionMethods inherited from class java.security.Permission
checkGuard, getName, toString
-
Constructor Details
-
FreeMarkerPermission
-
-
Method Details
-
checkPermission
Checks a permission if there is a SecurityManager installed in the JVM and the Configuration's isSecure() returns true.- Parameters:
config- the configuration that is checked for being secured.permission- the permission to check- Throws:
SecurityException- if the permission check fails.
-
checkPermission
Checks a permission if there is a SecurityManager installed in the JVM.- Parameters:
permission- the permission to check- Throws:
SecurityException- if the permission check fails.
-