diff options
Diffstat (limited to 'opendc/models/failure_model.py')
| -rw-r--r-- | opendc/models/failure_model.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/opendc/models/failure_model.py b/opendc/models/failure_model.py new file mode 100644 index 00000000..8dd16d6c --- /dev/null +++ b/opendc/models/failure_model.py @@ -0,0 +1,23 @@ +from opendc.models.model import Model + +class FailureModel(Model): + + JSON_TO_PYTHON_DICT = { + 'FailureModel': { + 'id': 'id', + 'name': 'name', + 'rate': 'rate' + } + } + + TABLE_NAME = 'failure_models' + COLUMNS = ['id', 'name', 'rate'] + COLUMNS_PRIMARY_KEY = ['id'] + + def google_id_has_at_least(self, google_id, authorization_level): + """Return True if the user has at least the given auth level over this FailureModel.""" + + if authorization_level in ['EDIT', 'OWN']: + return False + + return True |
