User quotas
Context
We want to limit the amount of data analysed by a users. Users have a default quota expressed in Gb uploaded data per week. In this context week refers to a sliding window of 7x24x3600 seconds. When the quota is passed, a user cannot submit any other analysis until the sliding window pass below the quota.
Features
- A default quota is set in backend/conf/application.conf (50Gb)
- This quota is stored in mongodb when the user logs-in for the first time
- Each time a user upload data (submits an analysis), the amount of data is measured and stored in mongodb along with the timestamp
- A function is able to compute how much data a user has uploaded the last 7 days
- When a user wants to submit an analysis but it's quota is exhausted, display an error message in the UI. Backend should prevent submission as well.
- An administrator should be able to change the limit for an individual user via running an mkadm command