Skip to content

Instantly share code, notes, and snippets.

View s8sg's full-sized avatar
🎯
Only Active On Weekend

Swarvanu Sengupta s8sg

🎯
Only Active On Weekend
View GitHub Profile
@s8sg
s8sg / cache.py
Created June 8, 2017 06:56
A cache dict implementation with object level timeout
import time
import collections
class Cache(collections.MutableMapping):
def __init__(self, timeout=1, *args, **kwargs):
self.__store = dict()
self.__time_table = dict()
self.__time_out = timeout
@s8sg
s8sg / GraphGist-SimpleRBAC.adoc
Last active August 18, 2020 05:27 — forked from mikesname/GraphGist-SimpleRBAC.adoc
Very simplistic way of doing role-based access control (RBAC) with Neo4j.

This is a very simple approach to doing role-based access control with Neo4j. It is optimistic, in the sense that all items are assumed to be world-readable unless they have specific constraints. Item visibility can be constrained to either individual users or all users who belong to a role. Roles are also hierarchical, so can inherit privileges from other roles.

This file is updated based on CYPHER guideline of 3.0

Setup:

Using docker is the easiest way to get started quickly

docker pull neo4j