# 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

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
[permissions](#section/Authentication-and-Authorization/Authorization),
file uploaders have additional permissions:

- **Users** can modify all items they uploaded themselves (identified by the
  user id in the `uploader` field).

- **Admins** can modify items for all users.

<br />

## Summary

For more efficient searching of study documents, a *summary* of available
metadata fields is returned in a `_summary` field of the response,
which contains additional information on metadata fields.
It lists all distinct values for each field along with the number of
documents available.

```

# 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


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
[permissions](#section/Authentication-and-Authorization/Authorization),
file uploaders have additional permissions:

- **Users** can modify all items they uploaded themselves (identified by the
  user id in the `uploader` field).

- **Admins** can modify items for all users.

<br />

## Summary

For more efficient searching of study documents, a *summary* of available
metadata fields is returned in a `_summary` field of the response,
which contains additional information on metadata fields.
It lists all distinct values for each field along with the number of
documents available.

```

_summary: