Interface ContentRestrictionService.Validator
- All Known Implementing Classes:
- DefaultContentRestrictionServiceValidator
- Enclosing interface:
- ContentRestrictionService
public static interface ContentRestrictionService.Validator
Validator interface.
 Used inside service implementation(s) for various validation purposes.
 
 Instance can be obtained via 
ContentRestrictionService.validator() method.- Since:
- 5.10
- 
Method SummaryModifier and TypeMethodDescriptionvalidateAddDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) Validates that: OperationKey supplied is supported Subject supplied is either User or a Group and does exist Content specified exists AND can be viewed by the currently logged-in user Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specifiedvalidateAddRestrictions(ContentId contentId, Collection<? extends ContentRestriction> contentRestrictions) Validates that: Content specified exists AND can be viewed by the currently logged-in user Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specified Input data is enough to proceed with the operation Input data should not conflict with any restrictions existingvalidateDeleteAllDirectRestrictions(ContentId contentId) Validates that: Content specified exists AND can be viewed by the currently logged-in user Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specifiedvalidateDeleteDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) Validates that: OperationKey supplied is supported Subject supplied is either User or a Group Content specified exists AND can be viewed by the currently logged-in user Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specifiedvalidateGetRestrictions(ContentId contentId) Validates whether content specified exists and whether currently logged in user can read restrictions on a content specified.validateGetRestrictionsForOperation(ContentId contentId, OperationKey opKey) Validates whether OperationKey supplied is supported, whether content specified exists, whether currently logged in user can read restrictions on a content specifiedvalidateHasDirectRestrictionsForSubject(ContentId contentId, OperationKey operationKey, Subject subject) Validates that: OperationKey supplied is supported Subject supplied is either User or a Group Content specified exists AND can be viewed by the currently logged-in uservalidateUpdateRestrictions(ContentId contentId, Collection<? extends ContentRestriction> contentRestrictions) Validates that: Content specified exists AND can be viewed by the currently logged-in user Input data is enough to proceed with the operation Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specified Returns first of the failed validation results or aValidationResultwhich is both authorised and valid.
- 
Method Details- 
validateGetRestrictionsValidates whether content specified exists and whether currently logged in user can read restrictions on a content specified.- Parameters:
- contentId- identifier of a content for which the check should be performed
- Returns:
- ValidationResultwhere- ValidationResult.isValid() == falsein case content is missing or unavailable.
- Since:
- 5.10
 
- 
validateGetRestrictionsForOperationValidates whether OperationKey supplied is supported, whether content specified exists, whether currently logged in user can read restrictions on a content specified- Parameters:
- contentId- identifier of a content for which the check should be performed
- opKey-- OperationKeywhich user tries to obtain restrictions for
- Returns:
- ValidationResultwhere- ValidationResult.isValid() == falsein case content is missing or unavailable or- OperationKeysupplied is not supported.
- Since:
- 5.10
- See Also:
 
- 
validateUpdateRestrictionsValidationResult validateUpdateRestrictions(ContentId contentId, Collection<? extends ContentRestriction> contentRestrictions) Validates that: Content specified exists AND can be viewed by the currently logged-in user Input data is enough to proceed with the operation Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specified Returns first of the failed validation results or aValidationResultwhich is both authorised and valid.- Parameters:
- contentId- identifier of a content for which the check should be performed
- contentRestrictions-- Collectionof something which can be cast to- ContentRestrictions.
- Returns:
- ValidationResultwhere- ValidationResult.isValid() == falseor- ValidationResult.isAuthorized() == falsein case something is wrong with the data passed. Returns completely okay ValidationResult otherwise.
- Since:
- 5.10
 
- 
validateAddRestrictionsValidationResult validateAddRestrictions(ContentId contentId, Collection<? extends ContentRestriction> contentRestrictions) Validates that: Content specified exists AND can be viewed by the currently logged-in user Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specified Input data is enough to proceed with the operation Input data should not conflict with any restrictions existing- Parameters:
- contentId- identifier of a content for which the check should be performed
- contentRestrictions-- Collectionof something which can be cast to- ContentRestrictions.
- Returns:
- ValidationResultwhere- ValidationResult.isValid() == falseor- ValidationResult.isAuthorized() == falsein case something is wrong with the data passed. Returns completely okay ValidationResult otherwise.
- Since:
- 5.10
 
- 
validateDeleteAllDirectRestrictionsValidates that: Content specified exists AND can be viewed by the currently logged-in user Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specified- Parameters:
- contentId- identifier of a content for which the check should be performed
- Returns:
- ValidationResultwhere- ValidationResult.isValid() == falseor- ValidationResult.isAuthorized() == falsein case something is wrong with the data passed. Returns completely okay ValidationResult otherwise.
- Since:
- 5.10
 
- 
validateHasDirectRestrictionsForSubjectValidationResult validateHasDirectRestrictionsForSubject(ContentId contentId, OperationKey operationKey, Subject subject) Validates that: OperationKey supplied is supported Subject supplied is either User or a Group Content specified exists AND can be viewed by the currently logged-in user- Parameters:
- contentId- identifier of a content for which the check should be performed
- Returns:
- ValidationResultwhere- ValidationResult.isValid() == falseor- ValidationResult.isAuthorized() == falsein case something is wrong with the data passed. Returns completely okay ValidationResult otherwise.
- Since:
- 5.10
 
- 
validateDeleteDirectRestrictionForSubjectValidationResult validateDeleteDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) Validates that: OperationKey supplied is supported Subject supplied is either User or a Group Content specified exists AND can be viewed by the currently logged-in user Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specified- Parameters:
- contentId-
- operationKey-
- subject-
- Returns:
- validation result
- Since:
- 5.10
 
- 
validateAddDirectRestrictionForSubjectValidationResult validateAddDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) Validates that: OperationKey supplied is supported Subject supplied is either User or a Group and does exist Content specified exists AND can be viewed by the currently logged-in user Currently logged-in user is allowed to alter ContentRestrictions on and edit the content specified- Parameters:
- contentId-
- operationKey-
- subject-
- Returns:
- validation result
- Since:
- 5.10
 
 
-