Skip to content

Commit

Permalink
perf: remove duplicated check (#117)
Browse files Browse the repository at this point in the history
* perf: remove duplicated check

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>

* perf: remove duplicated check

Signed-off-by: Zxilly <zhouxinyu1001@gmail.com>
  • Loading branch information
Zxilly authored Feb 3, 2021
1 parent be9ab9c commit 6aebadf
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions casbin/model/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ def add_policies(self,sec,ptype,rules):
def remove_policy(self, sec, ptype, rule):
"""removes a policy rule from the model."""

if sec not in self.model.keys():
return False
if ptype not in self.model[sec]:
return False

if not self.has_policy(sec, ptype, rule):
return False

Expand All @@ -106,11 +101,6 @@ def remove_policy(self, sec, ptype, rule):
def remove_policies(self, sec, ptype, rules):
"""RemovePolicies removes policy rules from the model."""

if sec not in self.model.keys():
return False
if ptype not in self.model[sec]:
return False

for rule in rules:
if not self.has_policy(sec,ptype,rule):
return False
Expand Down

0 comments on commit 6aebadf

Please sign in to comment.