8.4. Assigning Access to Stored Procedures

Documentation

Home » Documentation » Using VoltDB

8.4. Assigning Access to Stored Procedures

Once you define the users and roles you need, you assign them access to individual stored procedures using the ALLOW clause of the CREATE PROCEDURE statement in the schema. In the following example, users assigned to the roles admin and dbuser are permitted access to both the MyProc1 and MyProc2 procedures. Only users assigned the admin role have access to the MyProc3 procedure.

CREATE PROCEDURE ALLOW dbuser,admin FROM CLASS MyProc1;
CREATE PROCEDURE ALLOW dbuser,admin FROM CLASS MyProc2;
CREATE PROCEDURE ALLOW admin FROM CLASS MyProc3;

When security is enabled, you must specify access rights for each stored procedure. If a procedure declaration does not include an ALLOW clause, no access is allowed. In other words, calling applications will not be able to invoke that procedure.