Create permissions.py

This commit is contained in:
Corban-Lee Jones 2024-03-21 22:57:56 +00:00
parent 8d34a70931
commit 6d636ceea3

23
apps/api/permissions.py Normal file
View File

@ -0,0 +1,23 @@
# -*- encoding: utf-8 -*-
from rest_framework.permissions import BasePermission
class UserHasDiscordPermissions(BasePermission):
"""
Permission to ensure that the user is permitted to make
changes on behalf of the server they are representing.
"""
# class SubscriptionServerMember(BasePermission):
# """
# Permission for each subscription that omits the sub if
# the request user isn't a member of it's server.
# """
# def has_object_permission(self, request, view, obj):
# return obj.server in request.user.servers