Class PolicyServiceInternalImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.policy.internal.PolicyServiceInternalImpl
- All Implemented Interfaces:
PolicyServiceInternal
Default implementation of
PolicyServiceInternal
- Since:
- 4.0.0
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
protected String
protected ConfigurationService
protected ContentRepository
protected ContentRepository
protected List<PolicyValidator>
protected PolicyValidator
-
Constructor Summary
ConstructorsConstructorDescriptionPolicyServiceInternalImpl
(ContentRepository contentRepository, ContentRepository contentRepositoryV2, ConfigurationService configurationService, PolicyValidator systemValidator, List<PolicyValidator> policyValidators, String configPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
evaluateAction
(org.apache.commons.configuration2.HierarchicalConfiguration<?> config, String siteId, Action action, List<ValidationResult> results, boolean includeAllowed) protected void
evaluateRecursiveAction
(org.apache.commons.configuration2.HierarchicalConfiguration<?> config, String siteId, Action action, List<ValidationResult> results, boolean includeAllowed) protected String
getNewPath
(String siteId, String target) Get the new path by CREATE or RENAME action If all the path exists, return the file nameprotected org.apache.commons.configuration2.HierarchicalConfiguration<?>
getSubConfig
(org.apache.commons.configuration2.HierarchicalConfiguration<?> statement, String configKey) Performs the validation of one or more actions for a given siteprotected void
validateAction
(Action action)
-
Field Details
-
CONFIG_KEY_STATEMENT
- See Also:
-
CONFIG_KEY_PATTERN
- See Also:
-
CONFIG_KEY_PERMITTED
- See Also:
-
CONFIG_KEY_DENIED
- See Also:
-
contentRepository
-
contentRepositoryV2
-
configurationService
-
systemValidator
-
policyValidators
-
configPath
-
-
Constructor Details
-
PolicyServiceInternalImpl
@ConstructorProperties({"contentRepository","contentRepositoryV2","configurationService","systemValidator","policyValidators","configPath"}) public PolicyServiceInternalImpl(ContentRepository contentRepository, ContentRepository contentRepositoryV2, ConfigurationService configurationService, PolicyValidator systemValidator, List<PolicyValidator> policyValidators, String configPath)
-
-
Method Details
-
validate
public List<ValidationResult> validate(String siteId, List<Action> actions) throws ConfigurationException Description copied from interface:PolicyServiceInternal
Performs the validation of one or more actions for a given site- Specified by:
validate
in interfacePolicyServiceInternal
- Parameters:
siteId
- the id of the siteactions
- the list of actions to validate- Returns:
- the validation results
- Throws:
ConfigurationException
- if there any error parsing the configuration
-
validateAction
-
evaluateAction
protected void evaluateAction(org.apache.commons.configuration2.HierarchicalConfiguration<?> config, String siteId, Action action, List<ValidationResult> results, boolean includeAllowed) -
getSubConfig
protected org.apache.commons.configuration2.HierarchicalConfiguration<?> getSubConfig(org.apache.commons.configuration2.HierarchicalConfiguration<?> statement, String configKey) -
evaluateRecursiveAction
protected void evaluateRecursiveAction(org.apache.commons.configuration2.HierarchicalConfiguration<?> config, String siteId, Action action, List<ValidationResult> results, boolean includeAllowed) -
getNewPath
Get the new path by CREATE or RENAME action If all the path exists, return the file name- Parameters:
siteId
- site identifiertarget
- action target- Returns:
- the relative new path of the target
-