Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/793-fix #895

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions applications/workspaces/server/workspaces/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"/<path:filename>", endpoint="static", view_func=app.send_static_file)

app.add_url_rule(f"/<path:filename>", view_func=app.send_static_file)

def init_app(app):
cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
Expand All @@ -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


Expand All @@ -70,7 +69,6 @@ def init_app(app):




if __name__ == "__main__":
cloudharness.set_debug()
main()
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down
Loading