Class PolicyServiceInternalImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v2.service.policy.internal.PolicyServiceInternalImpl
-
- All Implemented Interfaces:
PolicyServiceInternal
public class PolicyServiceInternalImpl extends Object implements PolicyServiceInternal
Default implementation ofPolicyServiceInternal
- Since:
- 4.0.0
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_KEY_DENIED
static String
CONFIG_KEY_PATTERN
static String
CONFIG_KEY_PERMITTED
static String
CONFIG_KEY_STATEMENT
protected String
configPath
protected ConfigurationService
configurationService
protected ContentRepository
contentRepository
protected ContentRepository
contentRepositoryV2
protected List<PolicyValidator>
policyValidators
protected PolicyValidator
systemValidator
-
Constructor Summary
Constructors Constructor Description PolicyServiceInternalImpl(ContentRepository contentRepository, ContentRepository contentRepositoryV2, ConfigurationService configurationService, PolicyValidator systemValidator, List<PolicyValidator> policyValidators, String configPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 action If all the path exists, return the file nameprotected org.apache.commons.configuration2.HierarchicalConfiguration<?>
getSubConfig(org.apache.commons.configuration2.HierarchicalConfiguration<?> statement, String configKey)
List<ValidationResult>
validate(String siteId, List<Action> actions)
Performs the validation of one or more actions for a given siteprotected void
validateAction(Action action)
-
-
-
Field Detail
-
CONFIG_KEY_STATEMENT
public static final String CONFIG_KEY_STATEMENT
- See Also:
- Constant Field Values
-
CONFIG_KEY_PATTERN
public static final String CONFIG_KEY_PATTERN
- See Also:
- Constant Field Values
-
CONFIG_KEY_PERMITTED
public static final String CONFIG_KEY_PERMITTED
- See Also:
- Constant Field Values
-
CONFIG_KEY_DENIED
public static final String CONFIG_KEY_DENIED
- See Also:
- Constant Field Values
-
contentRepository
protected ContentRepository contentRepository
-
contentRepositoryV2
protected ContentRepository contentRepositoryV2
-
configurationService
protected ConfigurationService configurationService
-
systemValidator
protected PolicyValidator systemValidator
-
policyValidators
protected List<PolicyValidator> policyValidators
-
configPath
protected String configPath
-
-
Constructor Detail
-
PolicyServiceInternalImpl
@ConstructorProperties({"contentRepository","contentRepositoryV2","configurationService","systemValidator","policyValidators","configPath"}) public PolicyServiceInternalImpl(ContentRepository contentRepository, ContentRepository contentRepositoryV2, ConfigurationService configurationService, PolicyValidator systemValidator, List<PolicyValidator> policyValidators, String configPath)
-
-
Method Detail
-
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
protected void validateAction(Action action)
-
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)
-
-