diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-12-20 00:05:19 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-12-20 00:05:19 +0200 |
commit | 729205571e81b4767efc42ad7beb53663e08d1ff (patch) | |
tree | 54081fe5cf5494bf77f0df20780b21288ba97411 /src/backend/commands/typecmds.c | |
parent | 05e992e90e49aa5bca7e2b290ab736bfec97a7c1 (diff) | |
download | postgresql-729205571e81b4767efc42ad7beb53663e08d1ff.tar.gz postgresql-729205571e81b4767efc42ad7beb53663e08d1ff.zip |
Add support for privileges on types
This adds support for the more or less SQL-conforming USAGE privilege
on types and domains. The intent is to be able restrict which users
can create dependencies on types, which restricts the way in which
owners can alter types.
reviewed by Yeb Havinga
Diffstat (limited to 'src/backend/commands/typecmds.c')
-rw-r--r-- | src/backend/commands/typecmds.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index eda43d826fa..ea8f7f099a2 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -756,6 +756,11 @@ DefineDomain(CreateDomainStmt *stmt) errmsg("\"%s\" is not a valid base type for a domain", TypeNameToString(stmt->typeName)))); + aclresult = pg_type_aclcheck(basetypeoid, GetUserId(), ACL_USAGE); + if (aclresult != ACLCHECK_OK) + aclcheck_error(aclresult, ACL_KIND_TYPE, + format_type_be(basetypeoid)); + /* * Identify the collation if any */ |