Skip to content
  • Sofia Papagiannaki's avatar
    pithos: Reduce database interactions for access control. · be36a7d9
    Sofia Papagiannaki authored
    Each frontend method calls several backend methods.
    Each backend method checks whether the user has permission to access the
    specific path.
    This results to several identical queries to the database.
    This commit introduces the following optimization:
    We keep 2 dictionaries:
    * one for the allowed paths for read per user and
    * another for the allowed paths for write per user
    The lifespan of these dictionaries is a database transaction.
    The dictionaries are updated appropriately after each successful query for
    permissions and after actions that affect permissions
    (delete & update object permissions).
    Especially in the latter case the dictionaries are reset because it was
    estimated that this is less expensive than identifying the affected paths.
    
    Conflicts:
    	snf-pithos-backend/pithos/backends/modular.py
    be36a7d9