blob: 62fcb1ae90292166b78504a835798c8e6ed34dc4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
from opendc.models.model import Model
class AllowedObject(Model):
JSON_TO_PYTHON_DICT = {
'AllowedObject': {
'roomType': 'room_type',
'objectType': 'object_type'
}
}
COLLECTION_NAME = 'allowed_objects'
COLUMNS = ['room_type', 'object_type']
COLUMNS_PRIMARY_KEY = ['room_type', 'object_type']
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 AllowedObject."""
if authorization_level in ['EDIT', 'OWN']:
return False
return True
def to_JSON(self):
"""Return a JSON representation of this AllowedObject."""
return self.object_type
|