Security Policy
Table of Contents
Security in Katzebase is enforced through roles and the membership of accounts in those roles. Roles come in two varieties: administrators and non-administrators.
Administrators have unrestricted access to the database: all schemas and data, and every feature, including creating accounts and roles, managing memberships, configuration, and the system procedures that are restricted to administrators. An account that is a member of any role marked IsAdministrator is an administrator. The built-in admin account is a member of the Administrators role.
SELECT * FROM Master:Account
SELECT * FROM Master:Role
SELECT * FROM Master:MembershipCREATE ACCOUNT JohnDoe WITH (Password = '123abc!')DROP ACCOUNT JohnDoeCREATE ROLE SalespersonsCREATE ROLE SalesAdmins WITH (IsAdministrator = true)ALTER ROLE Salespersons ADD JohnDoe
ALTER ROLE Salespersons REMOVE JohnDoeDROP ROLE SalesAdminsSchema security is enforced by granting or denying permissions to roles.
Permissions are applied from the root down and can be overridden at any level, either by a policy for a specific schema or by another recursive policy.
To determine an account's permissions on a schema, the engine first checks the policies of the schema itself. Any permission that is still undefined is then looked up in the recursive policies of the schema's parent, and so on up to the root, until every permission has a rule.
This way you can deny a permission recursively at one level and then override it with a grant at a lower level.
Read permission allows an account to select from a schema and, with Recursive, from the schemas beneath it.
GRANT READ ON WordList:Word TO SalespersonsGRANT READ ON WordList TO Salespersons WITH (Recursive = true)DENY READ ON WordList:Word TO SalespersonsWrite permission allows an account to insert, update and delete documents. GRANT WRITE and DENY WRITE follow the same conventions as READ.
GRANT WRITE ON WordList TO Salespersons WITH (Recursive = true)Manage permission allows an account to manage a schema: create, drop, rebuild and analyze indexes, create child schemas, and grant or deny permissions on the schema to other roles.
GRANT MANAGE ON WordList TO Salespersons WITH (Recursive = true)GRANT ALL ON WordList:Language TO SalespersonsRevoking does not deny a permission; it removes the explicit policy, so the permission is inherited again.
REVOKE ALL ON WordList:Language FROM SalespersonsREVOKE MANAGE ON WordList FROM Salespersons- ShowSchemaPolicy('Schema'): shows the policy that applies to a schema.
- ShowMySchemaPolicy('Schema'): shows your own permissions on a schema and where each was inherited from.
- RefreshMyRoles(): reloads your role memberships without logging in again.
Home
The home page
SQL :: Keywords
A breakdown of all of the statements and keywords supported by the query processor.
SQL :: RefreshMyRoles
Reloads the role memberships of the logged in account. Roles are cached at login, so run this after your memberships change instead of logging out and back in. The roles are returned as messages.
SQL :: ShowMySchemaPolicy
Shows the permissions that the logged in account has on a schema, and the role and schema each was inherited from.
SQL :: ShowSchemaPolicy
Shows the security policy that applies to a schema: each permission, whether it is granted or denied, and the role and schema it was inherited from.