Interface AccountPermissionContextValidator<P extends AccountPermission>
-
- All Known Implementing Classes:
DefaultAccountPermissionContextValidator
public interface AccountPermissionContextValidator<P extends AccountPermission>
Various context-related validation functions for use when performing CRUD operations related to an account permission.This performs only context-related validations.
AccountPermissionValidator
is used for the more basic field validations.- Author:
- Samarth Dhruva (samarthd), Chris Kittrell (ckittrell)
- See Also:
AccountPermissionValidator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.springframework.validation.Errors
validateCreate(P permission, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a create operation is allowed in the current context.void
validateCreate(P permission, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a create operation is allowed in the current context.org.springframework.validation.Errors
validateDelete(P permission, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a delete operation is allowed in the current context.void
validateDelete(P permission, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a delete operation is allowed in the current context.org.springframework.validation.Errors
validateUpdate(String id, P permission, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates an update operation is allowed in the current context.void
validateUpdate(String id, P permission, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates an update operation is allowed in the current context.
-
-
-
Method Detail
-
validateCreate
org.springframework.validation.Errors validateCreate(P permission, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a create operation is allowed in the current context.- Parameters:
permission
- The permission to validatecontextInfo
- The current context- Returns:
- An
Errors
object bound to a {code permission} - See Also:
validateCreate(AccountPermission, Errors, ContextInfo)
-
validateUpdate
org.springframework.validation.Errors validateUpdate(String id, P permission, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates an update operation is allowed in the current context.- Parameters:
id
- the id of the permission being updated, explicitly provided such that it can be used to find the existing record even ifAccountPermission.getId()
is unsupplied inpermission
.permission
- The permission to validatecontextInfo
- The current context- Returns:
- An
Errors
object bound to a {code permission} - See Also:
validateUpdate(String, AccountPermission, Errors, ContextInfo)
-
validateDelete
org.springframework.validation.Errors validateDelete(P permission, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a delete operation is allowed in the current context.- Parameters:
permission
- the permission being deleted to validatecontextInfo
- The current context- Returns:
- An
Errors
object bound to a {code permission} - See Also:
validateDelete(AccountPermission, Errors, ContextInfo)
-
validateCreate
void validateCreate(P permission, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a create operation is allowed in the current context.- Parameters:
permission
- The permission to validateerrors
- An errors object bound to thepermission
to be validatedcontextInfo
- The current context
-
validateUpdate
void validateUpdate(String id, P permission, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates an update operation is allowed in the current context.- Parameters:
id
- the id of the permission being updated, explicitly provided such that it can be used to find the existing record even ifAccountPermission.getId()
is unsupplied inpermission
.permission
- The permission to validateerrors
- An errors object bound to thepermission
to be validatedcontextInfo
- The current context
-
validateDelete
void validateDelete(P permission, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates a delete operation is allowed in the current context.- Parameters:
permission
- The permission being deleted to validateerrors
- An errors object bound to thepermission
to be validatedcontextInfo
- The current context
-
-