Add requires_zed_cla column to channels table

Don't allow granting guests write access in a call where the channel
or one of its ancestors requires the zed CLA, until that guest has
signed the Zed CLA.

Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
Max Brunsfeld
2024-01-22 16:41:24 -08:00
co-authored by Marshall
parent 676d2cb24a
commit 25708088b7
14 changed files with 225 additions and 40 deletions
@@ -23,13 +23,13 @@ async fn test_contributors(db: &Arc<Database>) {
assert_eq!(db.get_contributors().await.unwrap(), Vec::<String>::new());
db.add_contributor("user1", 1, None).await.unwrap();
db.add_contributor("user1", Some(1), None).await.unwrap();
assert_eq!(
db.get_contributors().await.unwrap(),
vec!["user1".to_string()]
);
db.add_contributor("user2", 2, None).await.unwrap();
db.add_contributor("user2", Some(2), None).await.unwrap();
assert_eq!(
db.get_contributors().await.unwrap(),
vec!["user1".to_string(), "user2".to_string()]
+2 -2
View File
@@ -105,7 +105,7 @@ async fn test_get_or_create_user_by_github_account(db: &Arc<Database>) {
.user_id;
let user = db
.get_or_create_user_by_github_account("the-new-login2", 102, None)
.get_or_create_user_by_github_account("the-new-login2", Some(102), None)
.await
.unwrap();
assert_eq!(user.id, user_id2);
@@ -113,7 +113,7 @@ async fn test_get_or_create_user_by_github_account(db: &Arc<Database>) {
assert_eq!(user.github_user_id, Some(102));
let user = db
.get_or_create_user_by_github_account("login3", 103, Some("user3@example.com"))
.get_or_create_user_by_github_account("login3", Some(103), Some("user3@example.com"))
.await
.unwrap();
assert_eq!(&user.github_login, "login3");