diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2012-02-26 00:13:45 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2013-06-13 01:06:19 +0200 |
| commit | 454d48a87c2005981885b29411ebca494cd77ea1 (patch) | |
| tree | 11eb4398507033c7d80ba586ab74f11754e6655e /database/postgresql | |
| parent | bb885e9db4127439e120a1556aea27de2f6b6c76 (diff) | |
| download | eurephia-454d48a87c2005981885b29411ebca494cd77ea1.tar.gz eurephia-454d48a87c2005981885b29411ebca494cd77ea1.tar.xz eurephia-454d48a87c2005981885b29411ebca494cd77ea1.zip | |
edb-pgsql: Added an update SQL view for eurephia_adminlog
This is to restrict the eurephia-admin database user to only be
allowed to update a few fields of the eurephia_adminlog table.
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'database/postgresql')
| -rw-r--r-- | database/postgresql/sql-schema.sql | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/database/postgresql/sql-schema.sql b/database/postgresql/sql-schema.sql index 6634344..67e8841 100644 --- a/database/postgresql/sql-schema.sql +++ b/database/postgresql/sql-schema.sql @@ -204,6 +204,16 @@ CREATE TABLE eurephia_adminlog ( CREATE INDEX eurephia_adminlog_uid ON eurephia_adminlog(uid); CREATE INDEX eurephia_adminlog_sesskey ON eurephia_adminlog(sessionkey); +CREATE VIEW eurephia_adminlog_update AS + SELECT sessionkey, status, last_action, logout + FROM eurephia_adminlog; +CREATE RULE eurephia_adminlog_allow_update + AS ON UPDATE TO eurephia_adminlog_update + DO INSTEAD UPDATE eurephia_adminlog + SET status = NEW.status, last_action = NEW.last_action, + logout = NEW.logout + WHERE sessionkey = OLD.sessionkey; + -- Table eurephia_adminaccesss: Defines which modules eurephia users have access to. -- The access is defined per user account. uid refers -- to the user account in the users table. |
