# Path: amivapi/blacklist/authorization.py
# class BlacklistAuth(AmivTokenAuth):
#     def create_user_lookup_filter(self, user_id):
#         """Users can see their own signups."""
#         return {'user': user_id}
# 
#     def has_item_write_permission(self, user_id, item):
#         """Only admins have right permission, but we don't
#         have to care about them"""
#         return False


from amivapi.blacklist.authorization import BlacklistAuth
Contains model for blacklist.
"""


blacklist_description = ("""
People normally get blacklisted if they don't appear to an event they signed up
for, but other cases could be possible (Bad behaviour, etc). Once on the
blacklist, they shouldn't be able to sign up for any event until they pay
for that event or do something else the board decides (e.g. help at an event).

An entry on the blacklist always has a reason and a start_date (normally the
date of the event where the user didn't appear), most often also a price the
user has to pay to be removed from the blacklist.

One person can have multiple blacklist entries and old entries are not deleted,
but marked with an end date.

Only users with admin-rights for the blacklist can see all entries and create
new ones/edit them. A single user only has the right to see his own blacklist
entries, but he cannot edit them.
""")

blacklist = {

    'blacklist': {
        'description': blacklist_description,

        'resource_methods': ['POST', 'GET'],
        'item_methods': ['GET', 'PATCH', 'DELETE'],


# Path: amivapi/blacklist/authorization.py
# class BlacklistAuth(AmivTokenAuth):
#     def create_user_lookup_filter(self, user_id):
#         """Users can see their own signups."""
#         return {'user': user_id}
# 
#     def has_item_write_permission(self, user_id, item):
#         """Only admins have right permission, but we don't
#         have to care about them"""
#         return False


# Path: amivapi/blacklist/model.py
from amivapi.blacklist.authorization import BlacklistAuth

Contains model for blacklist.
"""


blacklist_description = ("""
People normally get blacklisted if they don't appear to an event they signed up
for, but other cases could be possible (Bad behaviour, etc). Once on the
blacklist, they shouldn't be able to sign up for any event until they pay
for that event or do something else the board decides (e.g. help at an event).

An entry on the blacklist always has a reason and a start_date (normally the
date of the event where the user didn't appear), most often also a price the
user has to pay to be removed from the blacklist.

One person can have multiple blacklist entries and old entries are not deleted,
but marked with an end date.

Only users with admin-rights for the blacklist can see all entries and create
new ones/edit them. A single user only has the right to see his own blacklist
entries, but he cannot edit them.
""")

blacklist = {

    'blacklist': {
        'description': blacklist_description,

        'resource_methods': ['POST', 'GET'],
        'item_methods': ['GET', 'PATCH', 'DELETE'],


        'authentication': BlacklistAuth,