mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 00:02:30 +00:00
test(datatables): run the tenant matcher test on the enterprise edition
The matcher it covers is enterprise code now, so without the enterprise edition the test hit the stub and failed the default windmill-common run. It runs with private and enterprise, and a counterpart without them asserts that no tenant list covers anyone, the wildcard and a workspace admin included. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BjfMkJyKzodxkobqGZ6Lqb
This commit is contained in:
co-authored by
Claude Opus 5
parent
4c2f1a7b60
commit
64d5f762dc
@@ -3152,6 +3152,7 @@ mod tests {
|
||||
DataTableRoleTenants { tenants: list.iter().map(|t| t.to_string()).collect() }
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "private", feature = "enterprise"))]
|
||||
#[test]
|
||||
fn a_tenant_list_covers_users_groups_folders_and_the_wildcard() {
|
||||
let groups = vec!["analysts".to_string()];
|
||||
@@ -3189,6 +3190,29 @@ mod tests {
|
||||
assert!(can_use_datatable_role(&tenants(&[]), &admin));
|
||||
}
|
||||
|
||||
#[cfg(not(all(feature = "private", feature = "enterprise")))]
|
||||
#[test]
|
||||
fn without_the_enterprise_edition_no_tenant_list_covers_anyone() {
|
||||
let groups = vec![];
|
||||
let folders = vec![];
|
||||
let scopes = None;
|
||||
let token_prefix = None;
|
||||
let is_admin = true;
|
||||
let is_operator = false;
|
||||
let admin = crate::db::AuthedRef {
|
||||
email: "alice@windmill.dev",
|
||||
username: "alice",
|
||||
is_admin: &is_admin,
|
||||
is_operator: &is_operator,
|
||||
groups: &groups,
|
||||
folders: &folders,
|
||||
scopes: &scopes,
|
||||
token_prefix: &token_prefix,
|
||||
};
|
||||
assert!(!can_use_datatable_role(&tenants(&["*"]), &admin));
|
||||
assert!(!can_use_datatable_role(&tenants(&["u/alice"]), &admin));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_datatable_ref_splits_off_its_role() {
|
||||
assert_eq!(parse_datatable_ref("sales").unwrap(), ("sales", None));
|
||||
|
||||
Reference in New Issue
Block a user