Exemplo n.º 1
0
Arquivo: authz.py Projeto: sunu/aleph
 def flush_role(cls, role):
     # Clear collections ACL cache.
     cache.kv.hdel(cls.ACCESS, role.id)
     if role.is_blocked or role.deleted_at is not None:
         # End all user sessions.
         prefix = cache.key(cls.TOKENS, "%s." % role.id)
         cache.flush(prefix=prefix)
Exemplo n.º 2
0
def resetcache():
    """Clear the redis cache."""
    cache.flush()