mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
explicitly set permissions to false for anonymous users
This commit is contained in:
parent
ccf484c9bc
commit
8f960cf359
@ -1,4 +1,5 @@
|
||||
from enum import Enum
|
||||
from flask_login import AnonymousUserMixin
|
||||
from app import db, login, mail, socketio
|
||||
from app.email import create_message
|
||||
from .avatar import *
|
||||
@ -141,6 +142,16 @@ def job_after_update_handler(mapper, connection, job):
|
||||
mail.send(msg)
|
||||
|
||||
|
||||
class AnonymousUser(AnonymousUserMixin):
|
||||
def can(self, permissions):
|
||||
return False
|
||||
|
||||
@property
|
||||
def is_administrator(self):
|
||||
return False
|
||||
|
||||
login.anonymous_user = AnonymousUser
|
||||
|
||||
|
||||
@login.user_loader
|
||||
def load_user(user_id):
|
||||
|
Loading…
Reference in New Issue
Block a user