summaryrefslogtreecommitdiff
path: root/opendc/models/scheduler.py
blob: c9523ce291a018bde1c76bd68b2ddda397d0f5cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from opendc.models.model import Model


class Scheduler(Model):
    JSON_TO_PYTHON_DICT = {
        'Scheduler': {
            'name': 'name'
        }
    }

    COLLECTION_NAME = 'schedulers'
    COLUMNS = ['name']
    COLUMNS_PRIMARY_KEY = ['name']

    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 Scheduler."""

        return authorization_level not in ['EDIT', 'OWN']