RBAC in ksql(3)
code snippet: creating role and access matrices
static const char *const stmts[] = { "INSERT INTO test (foo,bar,baz,xyzzy) VALUES (?,?,?,?)", "SELECT foo,bar,baz,xyzzy,id FROM test" }; int main(void) { const int stmts0[] = { 1, 1 }; const int stmts1[] = { 1, 1 }; const int stmts2[] = { 1, 1 }; const int stmts3[] = { 0, 0 }; const int roles0[] = { 1, 0, 0, 0 }; /* To noone. */ const int roles1[] = { 1, 1, 0, 0 }; /* Only to root. */ const int roles2[] = { 0, 1, 1, 0 }; /* Only to above. */ const int roles3[] = { 1, 1, 1, 1 }; /* To all. */ struct ksqlrole roles[4] = { { roles0, stmts0 }, { roles1, stmts1 }, { roles2, stmts2 }, { roles3, stmts3 }, }; /* ... */ return 0; }