anon users are now allowed in admin endpoints

This commit is contained in:
dogeystamp 2023-06-13 11:44:58 -04:00
parent 404393859b
commit b525f09487
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 5 additions and 5 deletions

View File

@ -9,17 +9,17 @@ admin_blueprint = Blueprint("admin_blueprint", __name__)
class ServerSettingsAPI(ModelAPI):
@auth_required(required_permissions=(Permissions.ADMIN,))
@auth_required(required_permissions=(Permissions.ADMIN,), allow_anonymous=True)
def get(self, auth_user=None):
settings = get_settings()
return super().get(settings)
@auth_required(required_permissions=(Permissions.ADMIN,))
@auth_required(required_permissions=(Permissions.ADMIN,), allow_anonymous=True)
def patch(self, auth_user=None):
settings = get_settings()
return super().patch(settings)
@auth_required(required_permissions=(Permissions.ADMIN,))
@auth_required(required_permissions=(Permissions.ADMIN,), allow_anonymous=True)
def put(self, auth_user=None):
settings = get_settings()
return super().put(settings)

View File

@ -197,12 +197,12 @@ users_blueprint.add_url_rule(
class UserListAPI(ModelListAPI):
@auth_required(required_permissions=(Permissions.ADMIN,))
@auth_required(required_permissions=(Permissions.ADMIN,), allow_anonymous=True)
def post(self, auth_user=None):
data = request.get_json()
return super().post(User, data)
@auth_required(required_permissions=(Permissions.ADMIN,))
@auth_required(required_permissions=(Permissions.ADMIN,), allow_anonymous=True)
def get(self, auth_user=None):
return super().get(User)