Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wh002 committed Jun 15, 2023
1 parent c97ac13 commit 7e1f044
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/runtime/ranger/ranger_resource_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,11 @@ access_control_result do_check_ranger_resource_policy<policy_check_type::kAllow>
}
auto check_status =
policy.policies.policies_check<policy_check_type::kAllow>(ac_type, user_name);
// When policy_check_type is 'kAllow' and in a 'allow_policies' and not in any
// 'allow_policies_exclude'.
if (policy_check_status::kAllowed == check_status) {
return access_control_result::kAllowed;
}

// In a 'policies' and in a 'policies_exclude' or not match.
// In a 'allow_policies' and in a 'allow_policies_exclude' or not match.
CHECK(policy_check_status::kPending == check_status ||
policy_check_status::kNotMatched == check_status,
"the policy check status must be kPending or kNotMatched");
Expand Down Expand Up @@ -184,13 +182,11 @@ access_control_result do_check_ranger_resource_policy<policy_check_type::kDeny>(
}
auto check_status =
policy.policies.policies_check<policy_check_type::kDeny>(ac_type, user_name);
// When policy_check_type is 'kDeny' and in a 'deny_policies' and not in any
// 'deny_policies_exclude'.
if (policy_check_status::kDenied == check_status) {
return access_control_result::kDenied;
}

// In a 'policies' and in a 'policies_exclude' or not match.
// In a 'deny_policies' and in a 'deny_policies_exclude' or not match.
CHECK(policy_check_status::kPending == check_status ||
policy_check_status::kNotMatched == check_status,
"the policy check status must be kPending or kNotMatched");
Expand Down

0 comments on commit 7e1f044

Please sign in to comment.