# Path: amivapi/settings.py
# DEPARTMENT_LIST = [
#     'itet',
#     'mavt',
#     'arch',
#     'baug',
#     'bsse',
#     'infk',
#     'matl',
#     'biol',
#     'chab',
#     'math',
#     'phys',
#     'erdw',
#     'usys',
#     'hest',
#     'mtec',
#     'gess'
# ]
# 
# Path: amivapi/studydocs/authorization.py
# class StudydocsAuth(AmivTokenAuth):
#     def has_item_write_permission(self, user_id, item):
#         return str(get_id(item['uploader'])) == user_id
# 
#     def has_resource_write_permission(self, user_id):
#         # All users can create studydocs
#         return True


from amivapi.settings import DEPARTMENT_LIST
from .authorization import StudydocsAuth
# -*- coding: utf-8 -*-
#
# license: AGPLv3, see LICENSE for details. In addition we strongly encourage
#          you to buy us beer if we meet and you like the software.
"""Model for studydocuments."""




description = ("""
Study-documents are all documents users want to share with other users
related to their studies (i.e. no personal documents).

This covers a wide range of files, from lecture material over old exams to
cheatsheets. Because of this diversity, there are no strict file categories.

Instead, multiple metadata fields such as `semester` or `professor` exist
which can be used (if they are relevant for the files) to allow other users
to find documents more easily. The more fields are provided, the better.
All fields that do not apply can be `Null`.

<br />

## Security


# Path: amivapi/settings.py
# DEPARTMENT_LIST = [
#     'itet',
#     'mavt',
#     'arch',
#     'baug',
#     'bsse',
#     'infk',
#     'matl',
#     'biol',
#     'chab',
#     'math',
#     'phys',
#     'erdw',
#     'usys',
#     'hest',
#     'mtec',
#     'gess'
# ]
# 
# Path: amivapi/studydocs/authorization.py
# class StudydocsAuth(AmivTokenAuth):
#     def has_item_write_permission(self, user_id, item):
#         return str(get_id(item['uploader'])) == user_id
# 
#     def has_resource_write_permission(self, user_id):
#         # All users can create studydocs
#         return True


# Path: amivapi/studydocs/model.py
from amivapi.settings import DEPARTMENT_LIST
from .authorization import StudydocsAuth

# -*- coding: utf-8 -*-
#
# license: AGPLv3, see LICENSE for details. In addition we strongly encourage
#          you to buy us beer if we meet and you like the software.
"""Model for studydocuments."""




description = ("""
Study-documents are all documents users want to share with other users
related to their studies (i.e. no personal documents).

This covers a wide range of files, from lecture material over old exams to
cheatsheets. Because of this diversity, there are no strict file categories.

Instead, multiple metadata fields such as `semester` or `professor` exist
which can be used (if they are relevant for the files) to allow other users
to find documents more easily. The more fields are provided, the better.
All fields that do not apply can be `Null`.

<br />

## Security


In addition to the usual