<s> from . rulesets import RuleSet <EOL> permissions = RuleSet ( ) <EOL> def add_perm ( name , pred ) : <EOL> permissions . add_rule ( name , pred ) <EOL> def remove_perm ( name ) : <EOL> permissions . remove_rule ( name ) <EOL> def perm_exists ( name ) : <EOL> return permissions . rule_exists ( name ) <EOL> def has_perm ( name , * args , ** kwargs ) : <EOL> return permissions . test_rule ( name , * args , ** kwargs ) <EOL> class ObjectPermissionBackend ( object ) : <EOL> def authenticate ( self , username , password ) : <EOL> return None <EOL> def has_perm ( self , user , perm , * args , ** kwargs ) : <EOL> return has_perm ( perm , user , * args , ** kwargs ) <EOL> def has_module_perms ( self , user , app_label ) : <EOL> return has_perm ( app_label , user ) </s>
