Create permissions.py
This commit is contained in:
parent
8d34a70931
commit
6d636ceea3
23
apps/api/permissions.py
Normal file
23
apps/api/permissions.py
Normal 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
|
Loading…
x
Reference in New Issue
Block a user