From b0bcf8aab2da6710ff8842b86fed93571e143cc8 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 21 Apr 2002 00:26:44 +0000 Subject: Restructure AclItem representation so that we can have more than eight different privilege bits (might as well make use of the space we were wasting on padding). EXECUTE and USAGE bits for procedures, languages now are separate privileges instead of being overlaid on SELECT. Add privileges for namespaces and databases. The GRANT and REVOKE commands work for these object types, but we don't actually enforce the privileges yet... --- doc/src/sgml/catalogs.sgml | 11 +++++++-- doc/src/sgml/ref/grant.sgml | 54 +++++++++++++++++++++++++++++++++++++++----- doc/src/sgml/ref/revoke.sgml | 12 ++++++++-- 3 files changed, 67 insertions(+), 10 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 66fedbce36..980c215536 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1,6 +1,6 @@ @@ -825,7 +825,7 @@ If true then this database can be used in the TEMPLATE clause of CREATE - DATABASE to create the new database as a clone of + DATABASE to create a new database as a clone of this one. @@ -890,6 +890,13 @@ Session defaults for run-time configuration variables + + + datacl + aclitem[] + + Access permissions + diff --git a/doc/src/sgml/ref/grant.sgml b/doc/src/sgml/ref/grant.sgml index 720c553957..70e9d581c8 100644 --- a/doc/src/sgml/ref/grant.sgml +++ b/doc/src/sgml/ref/grant.sgml @@ -1,5 +1,5 @@ @@ -18,7 +18,11 @@ PostgreSQL documentation GRANT { { SELECT | INSERT | UPDATE | DELETE | RULE | REFERENCES | TRIGGER } [,...] | ALL [ PRIVILEGES ] } - ON [ TABLE ] objectname [, ...] + ON [ TABLE ] tablename [, ...] + TO { username | GROUP groupname | PUBLIC } [, ...] + +GRANT { { CREATE | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] } + ON DATABASE dbname [, ...] TO { username | GROUP groupname | PUBLIC } [, ...] GRANT { EXECUTE | ALL [ PRIVILEGES ] } @@ -28,6 +32,10 @@ GRANT { EXECUTE | ALL [ PRIVILEGES ] } GRANT { USAGE | ALL [ PRIVILEGES ] } ON LANGUAGE langname [, ...] TO { username | GROUP groupname | PUBLIC } [, ...] + +GRANT { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] } + ON SCHEMA schemaname [, ...] + TO { username | GROUP groupname | PUBLIC } [, ...] @@ -36,7 +44,8 @@ GRANT { USAGE | ALL [ PRIVILEGES ] } The GRANT command gives specific permissions on - an object (table, view, sequence, function, procedural language) to + an object (table, view, sequence, database, function, procedural language, + or schema) to one or more users or groups of users. These permissions are added to those already granted, if any. @@ -144,6 +153,29 @@ GRANT { USAGE | ALL [ PRIVILEGES ] } + + CREATE + + + For databases, allows new schemas to be created in the database. + + + For schemas, allows new objects to be created within the specified + schema. + + + + + + TEMPORARY + TEMP + + + Allows temporary tables to be created while using the database. + + + + EXECUTE @@ -159,10 +191,16 @@ GRANT { USAGE | ALL [ PRIVILEGES ] } USAGE - Allows the use of the specified procedural language for the - creation of functions in that language. This is the only type + For procedural languages, allows the use of the specified language for + the creation of functions in that language. This is the only type of privilege that is applicable to procedural languages. + + For schemas, allows the use of objects contained in the specified + schema (assuming that the objects' own privilege requirements are + met). Essentially this allows the grantee to look up + objects within the schema. + @@ -226,7 +264,11 @@ GRANT { USAGE | ALL [ PRIVILEGES ] } R -- RULE x -- REFERENCES t -- TRIGGER - arwdRxt -- ALL PRIVILEGES + X -- EXECUTE + U -- USAGE + C -- CREATE + T -- TEMPORARY + arwdRxt -- ALL PRIVILEGES (for tables) diff --git a/doc/src/sgml/ref/revoke.sgml b/doc/src/sgml/ref/revoke.sgml index 60c31a37c8..3bc30cfd49 100644 --- a/doc/src/sgml/ref/revoke.sgml +++ b/doc/src/sgml/ref/revoke.sgml @@ -1,5 +1,5 @@ @@ -18,7 +18,11 @@ PostgreSQL documentation REVOKE { { SELECT | INSERT | UPDATE | DELETE | RULE | REFERENCES | TRIGGER } [,...] | ALL [ PRIVILEGES ] } - ON [ TABLE ] object [, ...] + ON [ TABLE ] tablename [, ...] + FROM { username | GROUP groupname | PUBLIC } [, ...] + +REVOKE { { CREATE | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] } + ON DATABASE dbname [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] REVOKE { EXECUTE | ALL [ PRIVILEGES ] } @@ -28,6 +32,10 @@ REVOKE { EXECUTE | ALL [ PRIVILEGES ] } REVOKE { USAGE | ALL [ PRIVILEGES ] } ON LANGUAGE langname [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] + +REVOKE { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] } + ON SCHEMA schemaname [, ...] + FROM { username | GROUP groupname | PUBLIC } [, ...] -- cgit v1.2.1