Revision 0d573e18
ID | 0d573e18e8886457eb728d6ab2b7dd3e373faf4b |
pithos: Reduce database interactions for access control.
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
Files
- added
- modified
- copied
- renamed
- deleted