lineage protection
This commit is contained in:
parent
ac5675cf18
commit
ad85d802fe
1 changed files with 5 additions and 5 deletions
|
|
@ -364,10 +364,7 @@ sub getLineage {
|
||||||
# now lets add in all of the siblings in every level between ourself and the asset we wish to pedigree
|
# now lets add in all of the siblings in every level between ourself and the asset we wish to pedigree
|
||||||
if (isIn("pedigree",@{$relatives}) && exists $rules->{assetToPedigree}) {
|
if (isIn("pedigree",@{$relatives}) && exists $rules->{assetToPedigree}) {
|
||||||
my $pedigreeLineage = $rules->{assetToPedigree}->get("lineage");
|
my $pedigreeLineage = $rules->{assetToPedigree}->get("lineage");
|
||||||
if (substr($pedigreeLineage,0,length($lineage)) ne $lineage) {
|
if (substr($pedigreeLineage,0,length($lineage)) eq $lineage) {
|
||||||
push @whereModifiers, '0';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
my @mods;
|
my @mods;
|
||||||
my $length = $rules->{assetToPedigree}->getLineageLength;
|
my $length = $rules->{assetToPedigree}->getLineageLength;
|
||||||
for (my $i = $length; $i > 0; $i--) {
|
for (my $i = $length; $i > 0; $i--) {
|
||||||
|
|
@ -427,7 +424,10 @@ sub getLineage {
|
||||||
$where .= ' and (asset.className in ('.$self->session->db->quoteAndJoin($rules->{includeOnlyClasses}).'))';
|
$where .= ' and (asset.className in ('.$self->session->db->quoteAndJoin($rules->{includeOnlyClasses}).'))';
|
||||||
}
|
}
|
||||||
## finish up our where clause
|
## finish up our where clause
|
||||||
$where .= ' and ('.join(" or ",@whereModifiers).')' if (scalar(@whereModifiers));
|
if (!scalar(@whereModifiers)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
$where .= ' and ('.join(" or ",@whereModifiers).')';
|
||||||
if (exists $rules->{whereClause} && $rules->{whereClause}) {
|
if (exists $rules->{whereClause} && $rules->{whereClause}) {
|
||||||
$where .= ' and ('.$rules->{whereClause}.')';
|
$where .= ' and ('.$rules->{whereClause}.')';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue