Bugzilla – Attachment 7678 Details for
Bug 7310
Improving permissions on lists (virtual shelves)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH 1]DB revision for Improving list permissions
patch.txt (text/plain), 3.16 KB, created by
Marcel de Rooy
on 2012-02-16 11:39:38 UTC
(
hide
)
Description:
[PATCH 1]DB revision for Improving list permissions
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2012-02-16 11:39:38 UTC
Size:
3.16 KB
patch
obsolete
>From a1f3736756541474790173a557fb46cbac14c09b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 8 Dec 2011 16:10:57 +0100 >Subject: [PATCH] 7310a: DB revision for Improving list permissions >Content-Type: text/plain; charset="utf-8" > >DB revision for improving list permissions. >Adds new table virtualshelfshares for maintaining shared private lists. >Adds three columns to virtualshelves for permissions per list. >Adds column borrowernumber to virtualshelfcontents. > >Feb 16, 2012: Rebased. >--- > installer/data/mysql/updatedatabase.pl | 25 +++++++++++++++++++++++++ > 1 files changed, 25 insertions(+), 0 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 0ef0b1f..9a21bef 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4684,6 +4684,31 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion($DBversion); > } > >+$DBversion = "3.07.99.XXX"; #FIXME >+if ( C4::Context->preference("Version") lt TransformToNum($DBversion) ) { >+ $dbh->do("ALTER TABLE virtualshelves MODIFY COLUMN owner int"); #should have been int already (fk to borrowers) >+ $dbh->do("ALTER TABLE virtualshelves ADD COLUMN allow_add tinyint(1) DEFAULT 1, ADD COLUMN allow_delete_own tinyint(1) DEFAULT 1, ADD COLUMN allow_delete_other tinyint(1) DEFAULT 0"); >+ $dbh->do("UPDATE virtualshelves SET allow_add=1, allow_delete_own=1, allow_delete_other=0 WHERE category=1"); >+ $dbh->do("UPDATE virtualshelves SET allow_add=1, allow_delete_own=1, allow_delete_other=1 WHERE category=2"); #former behavior >+ $dbh->do("UPDATE virtualshelves SET allow_add=1, allow_delete_own=1, allow_delete_other=1 WHERE category=3"); >+ $dbh->do("UPDATE virtualshelves SET category=2 WHERE category=3"); >+ >+ $dbh->do("ALTER TABLE virtualshelfcontents ADD COLUMN borrowernumber int"); >+ $dbh->do("UPDATE virtualshelfcontents co LEFT JOIN virtualshelves sh USING (shelfnumber) SET co.borrowernumber=sh.owner"); >+ >+ $dbh->do("CREATE TABLE virtualshelfshares >+ (id int AUTO_INCREMENT PRIMARY KEY, shelfnumber int NOT NULL, >+ borrowernumber int, invitekey varchar(10), sharedate datetime, >+ CONSTRAINT `virtualshelfshares_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8"); >+ >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAllowPublicListCreation',1,'If set, allows opac users to create public lists',NULL,'YesNo');"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAllowSharingPrivateLists',0,'If set, allows opac users to share private lists with other patrons',NULL,'YesNo');"); >+ >+ print "Upgrade to $DBversion done (BZ7310: Improving list permissions)\n"; >+ print "NOTE: If you want to make your public lists read-only, please check the permissions on list level or run a sql update statement on the virtualshelves table just like the ones in the updatedatabase script.\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >-- >1.6.0.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7310
:
7092
|
7678
|
7679
|
7680
|
7681
|
7682
|
7769
|
7819
|
7820
|
7821
|
7823
|
7824
|
7825
|
7828
|
7873
|
7874
|
7875
|
7876
|
7877
|
7878
|
7879
|
7909
|
7910
|
7925
|
7926
|
7939
|
7940
|
7942
|
7953
|
8006
|
8007
|
8008
|
8009
|
8259
|
8260
|
8261
|
8262
|
8263
|
8264
|
8265
|
8266
|
8267
|
8410
|
8411
|
8412
|
8467
|
8519