1.1 --- a/imiptools/stores/file.py Thu Mar 10 01:43:31 2016 +0100
1.2 +++ b/imiptools/stores/file.py Fri Mar 11 01:33:45 2016 +0100
1.3 @@ -810,6 +810,23 @@
1.4
1.5 return dict(self._get_table_atomic(quota, filename, tab_separated=False))
1.6
1.7 + def set_limit(self, quota, group, limit):
1.8 +
1.9 + """
1.10 + For the given 'quota', set for a user 'group' the given 'limit' on
1.11 + resource usage.
1.12 + """
1.13 +
1.14 + filename = self.get_object_in_store(quota, "limits")
1.15 + if not filename:
1.16 + return None
1.17 +
1.18 + limits = self.get_limits(quota) or {}
1.19 + limits[group] = limit
1.20 +
1.21 + self._set_table_atomic(quota, filename, limits.items())
1.22 + return True
1.23 +
1.24 # Free/busy period access for users within quota groups.
1.25
1.26 def get_freebusy(self, quota, user, mutable=False):