Mercurial > gemma
comparison controllers/user.go @ 343:5b03f420957d
Use INSTEAD OF trigger for user creation
Now make the whole thing look like a real table.
There is no more function in schema sys_admin, thus remove respective
privilege test.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 06 Aug 2018 13:25:18 +0200 |
parents | c6bd6ed18942 |
children |
comparison
equal
deleted
inserted
replaced
342:c6bd6ed18942 | 343:5b03f420957d |
---|---|
9 | 9 |
10 "gemma.intevation.de/gemma/auth" | 10 "gemma.intevation.de/gemma/auth" |
11 ) | 11 ) |
12 | 12 |
13 const ( | 13 const ( |
14 createUserSQL = `SELECT sys_admin.create_user($1, $2, $3, $4, NULL, $5)` | 14 createUserSQL = `INSERT INTO users.list_users |
15 createUserExtentSQL = `SELECT sys_admin.create_user($1, $2, $3, $4, | 15 VALUES ($1, $2, $3, $4, NULL, $5)` |
16 createUserExtentSQL = `INSERT INTO users.list_users | |
17 VALUES ($1, $2, $3, $4, | |
16 ST_MakeBox2D(ST_Point($5, $6), ST_Point($7, $8)), $9)` | 18 ST_MakeBox2D(ST_Point($5, $6), ST_Point($7, $8)), $9)` |
17 | 19 |
18 updateUserUnprivSQL = `UPDATE users.list_users | 20 updateUserUnprivSQL = `UPDATE users.list_users |
19 SET (pw, map_extent, email_address) | 21 SET (pw, map_extent, email_address) |
20 = ($2, ST_MakeBox2D(ST_Point($3, $4), ST_Point($5, $6)), $7) | 22 = ($2, ST_MakeBox2D(ST_Point($3, $4), ST_Point($5, $6)), $7) |