Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Make has_sequence_privilege support WITH GRANT OPTION
authorJoe Conway <mail@joeconway.com>
Sun, 26 Nov 2017 17:50:42 +0000 (09:50 -0800)
committerJoe Conway <mail@joeconway.com>
Sun, 26 Nov 2017 17:50:42 +0000 (09:50 -0800)
The various has_*_privilege() functions all support an optional
WITH GRANT OPTION added to the supported privilege types to test
whether the privilege is held with grant option. That is, all except
has_sequence_privilege() variations. Fix that.

Back-patch to all supported branches.

Discussion: https://postgr.es/m/005147f6-8280-42e9-5a03-dd2c1e4397ef@joeconway.com

src/backend/utils/adt/acl.c

index ed60dbc4853167625d740a652cadcec99ed3a827..674e89602abe7f7431a1bf6e28d2eff9dd505345 100644 (file)
@@ -2244,8 +2244,11 @@ convert_sequence_priv_string(text *priv_type_text)
 {
    static const priv_map sequence_priv_map[] = {
        {"USAGE", ACL_USAGE},
+       {"USAGE WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_USAGE)},
        {"SELECT", ACL_SELECT},
+       {"SELECT WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_SELECT)},
        {"UPDATE", ACL_UPDATE},
+       {"UPDATE WITH GRANT OPTION", ACL_GRANT_OPTION_FOR(ACL_UPDATE)},
        {NULL, 0}
    };