Managing Model Security

You can manage the security privileges on your models by using the GRANT and REVOKE statements. The following examples show how you can change privileges on user1 and user2 using the faithful table using the linearReg model.

=> SELECT LINEAR_REG('linearReg', 'faithful', 'waiting', 'eruptions');
LINEAR_REG
---------------------------
Finished in 1 iterations
(1 row)
=> GRANT USAGE ON MODEL linearReg TO user2;
GRANT PRIVILEGE
=> \c - user2
=> SELECT SUMMARIZE_MODEL('linearReg');

summarize_model
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
coeff names : {Intercept, eruptions}
coeffecients: {33.47439702, 10.7296414}
std_err:      {1.155, 0.3148}
t_value:      {28.99, 34.09}
p_value:      {< 1e-20, < 1e-20}
Number of iterations: 1, Number of skipped samples: 0, Number of processed samples: 272
Call:linear_reg('linearReg', 'faithful', '"waiting"', 'eruptions'
USING PARAMETERS optimizer='newton', epsilon=1e-06, max_iterations=100)
(1 row)
=> \c - user1
=> REVOKE USAGE ON MODEL linearReg FROM user2;
REVOKE PRIVILEGE
=> \c - user2
=>SELECT SUMMARIZE_MODEL('linearReg');
ERROR 7523:  Problem in summarize_model.
Detail: Permission denied for model linearReg

See Also