Skip to content

Commit

Permalink
Merge pull request #4272 from systeminit/chore(sdf)--Add-logging-when…
Browse files Browse the repository at this point in the history
…-someone-has-no-permission-to-create-a-workspace

chore(sdf): Add logging when someone has no permission to create a workspace
  • Loading branch information
stack72 authored Aug 2, 2024
2 parents ab3102d + 5e08590 commit 5b46ab9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/sdf-server/src/server/service/session/auth_connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use dal::workspace_snapshot::graph::WorkspaceSnapshotGraphDiscriminants;
use dal::{DalContext, HistoryActor, KeyPair, Tenancy, User, UserPk, Workspace, WorkspacePk};
use serde::{Deserialize, Serialize};
use serde_json::json;
use telemetry::tracing::warn;

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -132,6 +133,11 @@ async fn find_or_create_user_and_workspace(
let _key_pair = KeyPair::new(&ctx, "default").await?;
workspace
} else {
warn!(
"user: {} has no permissions to create workspace: {:#?}",
&user.email(),
create_workspace_allowlist
);
return Err(SessionError::WorkspacePermissions);
}
}
Expand Down

0 comments on commit 5b46ab9

Please sign in to comment.