diff options
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_table_access_only.txt')
-rw-r--r-- | js/scripting-lang/scratch_tests/test_table_access_only.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_table_access_only.txt b/js/scripting-lang/scratch_tests/test_table_access_only.txt new file mode 100644 index 0000000..0874c0f --- /dev/null +++ b/js/scripting-lang/scratch_tests/test_table_access_only.txt @@ -0,0 +1,15 @@ +/* Test just the table access part */ + +/* User data for testing */ +admin_user : {role: "admin", level: 5, name: "Alice"}; + +/* Access control using table access in patterns */ +access_level : user -> + when user.role is + "admin" then "full access" + "user" then "limited access" + _ then "no access"; + +/* Test access control */ +admin_access : access_level admin_user; +..out admin_access; \ No newline at end of file |