blob: 48f2abd536dc085854ce314ac6c90d5eb26c8f50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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
|