From 6d636ceea3fb3e267a505a65bace9053c8432d93 Mon Sep 17 00:00:00 2001 From: corbz Date: Thu, 21 Mar 2024 22:57:56 +0000 Subject: [PATCH] Create permissions.py --- apps/api/permissions.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 apps/api/permissions.py diff --git a/apps/api/permissions.py b/apps/api/permissions.py new file mode 100644 index 0000000..38e8cc2 --- /dev/null +++ b/apps/api/permissions.py @@ -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 \ No newline at end of file