add channel permission manager

This commit is contained in:
rmanach 2023-09-18 15:52:30 +02:00
parent 89bc1ca87d
commit d12ef62f78
3 changed files with 7 additions and 1 deletions

6
deployment/channel.py Normal file
View File

@ -0,0 +1,6 @@
from django_eventstream.channelmanager import DefaultChannelManager
class DeploymentChannelManager(DefaultChannelManager):
def can_read_channel(self, user, channel):
return user.is_authenticated

View File

@ -1,5 +1,4 @@
from enum import Enum from enum import Enum
from uuid import uuid4
from django.contrib.auth.models import User from django.contrib.auth.models import User

View File

@ -133,5 +133,6 @@ LOGIN_REDIRECT_URL = "home"
LOGOUT_REDIRECT_URL = "home" LOGOUT_REDIRECT_URL = "home"
GRIP_URL = "http://pushpin:5561" GRIP_URL = "http://pushpin:5561"
EVENTSTREAM_CHANNELMANAGER_CLASS = "deployment.channel.DeploymentChannelManager"
CSRF_TRUSTED_ORIGINS = ["http://localhost:8080"] CSRF_TRUSTED_ORIGINS = ["http://localhost:8080"]