summaryrefslogtreecommitdiff
path: root/opendc/models/scheduler.py
blob: 9d78ec6f7b7a8421cee5500845e000edabffc776 (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'
        }
    }

    TABLE_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']