From 85add42a570cdb4be2d674e62535eb54b4dcd5cf Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 9 Jun 2000 15:51:02 +0000 Subject: I have large database and with this DB work more users and I very need more restriction for fretful users. The current PG allow define only NO-CREATE-DB and NO-CREATE-USER restriction, but for some users I need NO-CREATE-TABLE and NO-LOCK-TABLE. This patch add to current code NOCREATETABLE and NOLOCKTABLE feature: CREATE USER username [ WITH [ SYSID uid ] [ PASSWORD 'password' ] ] [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ] -> [ CREATETABLE | NOCREATETABLE ] [ LOCKTABLE | NOLOCKTABLE ] ...etc. If CREATETABLE or LOCKTABLE is not specific in CREATE USER command, as default is set CREATETABLE or LOCKTABLE (true). A user with NOCREATETABLE restriction can't call CREATE TABLE or SELECT INTO commands, only create temp table is allow for him. Karel --- src/include/nodes/parsenodes.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/include/nodes') diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index c4fae8b045..dbb5ab9338 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parsenodes.h,v 1.106 2000/06/09 01:44:26 momjian Exp $ + * $Id: parsenodes.h,v 1.107 2000/06/09 15:51:02 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -290,7 +290,7 @@ typedef struct DropPLangStmt /* ---------------------- - * Create/Alter/Drop User Statements + * Create/Alter/Drop User Statements * ---------------------- */ typedef struct CreateUserStmt @@ -301,6 +301,8 @@ typedef struct CreateUserStmt int sysid; /* PgSQL system id (-1 if don't care) */ bool createdb; /* Can the user create databases? */ bool createuser; /* Can this user create users? */ + bool createtable; /* Can this user create tables? */ + bool locktable; /* Can this user lock tables? */ List *groupElts; /* The groups the user is a member of */ char *validUntil; /* The time the login is valid until */ } CreateUserStmt; @@ -312,6 +314,8 @@ typedef struct AlterUserStmt char *password; /* PostgreSQL user password */ int createdb; /* Can the user create databases? */ int createuser; /* Can this user create users? */ + bool createtable; /* Can this user create tables? */ + bool locktable; /* Can this user lock tables? */ char *validUntil; /* The time the login is valid until */ } AlterUserStmt; -- cgit v1.2.1