diff --git a/applications/workspaces/server/workspaces/__main__.py b/applications/workspaces/server/workspaces/__main__.py index 9dd4ee09..b5d87414 100644 --- a/applications/workspaces/server/workspaces/__main__.py +++ b/applications/workspaces/server/workspaces/__main__.py @@ -32,8 +32,7 @@ def setup_static_router(app): # remove the static route (if exists) app.url_map._rules_by_endpoint["static"] = [] # add / as static route - app.add_url_rule(f"/", endpoint="static", view_func=app.send_static_file) - + app.add_url_rule(f"/", view_func=app.send_static_file) def init_app(app): cors = CORS(app, resources={r"/api/*": {"origins": "*"}}) @@ -56,7 +55,7 @@ def init_app(app): "Could not start kafka consumers. Some application functionality won't be available.", exc_info=True ) mkdirs() - # setup_static_router(app) + setup_static_router(app) app.template_folder = Config.TEMPLATE_DIR @@ -70,7 +69,6 @@ def init_app(app): - if __name__ == "__main__": cloudharness.set_debug() main() diff --git a/applications/workspaces/server/workspaces/service/crud_service.py b/applications/workspaces/server/workspaces/service/crud_service.py index 01bfbe3b..88f9cdae 100644 --- a/applications/workspaces/server/workspaces/service/crud_service.py +++ b/applications/workspaces/server/workspaces/service/crud_service.py @@ -242,8 +242,6 @@ def clone(self, workspace_id): def is_authorized(self, workspace): current_user_id = keycloak_user_id() - if not current_user_id: - return False return workspace and (workspace.publicable or (workspace.user_id and workspace.user_id == current_user_id) or (get_auth_client().user_has_realm_role(user_id=current_user_id, role="administrator")))