Skip to content

Commit

Permalink
return None when policy in db isn't p*, g*
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng JIANG committed Apr 18, 2020
1 parent 2606270 commit c338379
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ impl<'a> DieselAdapter {
is_filtered = true
}
}
}
if sec == 'g' {
} else if sec == 'g' {
for (i, rule) in f.g.iter().enumerate() {
if !rule.is_empty() && rule != &policy[i] {
is_filtered = true
}
}
} else {
return None;
}

if !is_filtered {
return Some(policy);
}
Expand Down

0 comments on commit c338379

Please sign in to comment.