Project

General

Profile

« Previous | Next » 

Revision 9632

lib/sh/db.sh: added mysql_seal_table(), which prevents further modifications to a table by a user. this uses new mysql_root().

View differences:

lib/sh/db.sh
198 198
-e '^(UN)?LOCK TABLES( `.*` WRITE)?;$'
199 199
}
200 200

  
201
## permissions
201 202

  
203
mysql_seal_table() # usage: table=... user=... mysql_seal_table
204
# prevents further modifications to a table by a user
205
{
206
	echo_func; kw_params table user; : "${table:?}" "${user:?}"
207
	set_database; mk_table_esc
208
	
209
	mysql_root <<<"REVOKE ALL PRIVILEGES ON $database.$table FROM '$user'@'%'"
210
}
211

  
212

  
202 213
### PostgreSQL
203 214

  
204 215
pg_export()

Also available in: Unified diff