Skip to content

Commit 086560e

Browse files
committed
Fix js_authorizer() validation for bad rules
1 parent 1f217ca commit 086560e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/database.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,11 @@ impl Database {
393393
} else if value == 1 {
394394
// Authorization.DENY
395395
auth.deny(&key);
396+
} else {
397+
return cx.throw_error(format!(
398+
"Invalid authorization rule value '{}' for table '{}'. Expected 0 (ALLOW) or 1 (DENY).",
399+
value, key
400+
));
396401
}
397402
}
398403
let auth = auth.build();

0 commit comments

Comments
 (0)