diff --git a/casbin/model/policy.py b/casbin/model/policy.py index c52c193c..a414ecc9 100644 --- a/casbin/model/policy.py +++ b/casbin/model/policy.py @@ -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 @@ -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