}
private AuthorizationViolation defineOctopusViolation(InvocationContext invocationContext, Permission violatedPermission) {
String permissionInfo = null;
if (violatedPermission instanceof NamedDomainPermission) {
NamedDomainPermission namedPermission = (NamedDomainPermission) violatedPermission;
permissionInfo = "Permission " + namedPermission.getName();
}
if (violatedPermission instanceof NamedApplicationRole) {
NamedApplicationRole namedRole = (NamedApplicationRole) violatedPermission;
permissionInfo = "Role " + namedRole.getRoleName();
}