diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-07-31 09:30:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-07-31 09:30:09 +0000 |
commit | 202eee42a929a0f48ce693e10943cc156ef5a7ef (patch) | |
tree | ae4b6845c42c09529c28dbe153acb21aca5eef6c /database | |
parent | aed1b0ca9e89d085b557d2d1e61da2cf07ce6072 (diff) | |
download | brdo-202eee42a929a0f48ce693e10943cc156ef5a7ef.tar.gz brdo-202eee42a929a0f48ce693e10943cc156ef5a7ef.tar.bz2 |
- Patch #9543 by JonBob: added node-level access control!
Diffstat (limited to 'database')
-rw-r--r-- | database/database.mysql | 18 | ||||
-rw-r--r-- | database/updates.inc | 19 |
2 files changed, 35 insertions, 2 deletions
diff --git a/database/database.mysql b/database/database.mysql index 003fb35d2..30591c8ef 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -339,7 +339,21 @@ CREATE TABLE node ( KEY node_changed (changed) ) TYPE=MyISAM; --- +# +# Table structure for table `node_access` +# + +CREATE TABLE node_access ( + nid int(10) unsigned NOT NULL default '0', + gid int(10) unsigned NOT NULL default '0', + realm varchar(255) NOT NULL default '', + grant_view tinyint(1) unsigned NOT NULL default '0', + grant_update tinyint(1) unsigned NOT NULL default '0', + grant_delete tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (nid,gid,realm) +) TYPE=MyISAM; + +- -- Table structure for table 'page' -- @@ -682,3 +696,5 @@ REPLACE blocks SET module = 'user', delta = '0', status = '1'; REPLACE blocks SET module = 'user', delta = '1', status = '1'; INSERT INTO sequences (name, id) VALUES ('menu_mid', 1); + +INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0); diff --git a/database/updates.inc b/database/updates.inc index ef1d86968..501f7cd15 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -65,7 +65,8 @@ $sql_updates = array( "2004-06-30" => "update_91", "2004-07-07" => "update_92", "2004-07-11" => "update_93", - "2004-07-22" => "update_94" + "2004-07-22" => "update_94", + "2004-07-30" => "update_95" ); function update_32() { @@ -1187,6 +1188,22 @@ function update_94() { return $ret; } +function update_95() { + $ret = array(); + + $ret[] = update_sql("CREATE TABLE node_access ( + nid int(10) unsigned NOT NULL default '0', + gid int(10) unsigned NOT NULL default '0', + realm varchar(255) NOT NULL default '', + grant_view tinyint(1) unsigned NOT NULL default '0', + grant_update tinyint(1) unsigned NOT NULL default '0', + grant_delete tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (nid,gid,realm) + )"); + $ret[] = update_sql("INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);"); + return $ret; +} + function update_sql($sql) { $edit = $_POST["edit"]; $result = db_query($sql); |