[Koha-bugs] [Bug 7310] Improving permissions on lists (virtual shelves)

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 22 17:14:02 CET 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7310

--- Comment #88 from Paul Poulain <paul.poulain at biblibre.com> ---
I just pushed a small follow-up : it was written lt instead of < in DBrev
number comparison, that made updatedatabase not working well.

Ppl running master should apply manually the following SQL:
ALTER TABLE virtualshelves MODIFY COLUMN owner int;
UPDATE virtualshelves vi LEFT JOIN borrowers bo ON bo.borrowernumber=vi.owner
SET vi.owner=NULL where bo.borrowernumber IS NULL;
DELETE FROM virtualshelves WHERE owner IS NULL and category=1;
ALTER TABLE virtualshelves ADD COLUMN allow_add tinyint(1) DEFAULT 0, ADD
COLUMN allow_delete_own tinyint(1) DEFAULT 1, ADD COLUMN allow_delete_other
tinyint(1) DEFAULT 0, ADD CONSTRAINT `virtualshelves_ibfk_1` FOREIGN KEY
(`owner`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON
UPDATE SET NULL;
UPDATE virtualshelves SET allow_add=0, allow_delete_own=1, allow_delete_other=0
WHERE category=1;
UPDATE virtualshelves SET allow_add=0, allow_delete_own=1, allow_delete_other=0
WHERE category=2;
UPDATE virtualshelves SET allow_add=1, allow_delete_own=1, allow_delete_other=1
WHERE category=3;
UPDATE virtualshelves SET category=2 WHERE category=3;

ALTER TABLE virtualshelfcontents ADD COLUMN borrowernumber int, ADD CONSTRAINT
`shelfcontents_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers`
(`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL;
UPDATE virtualshelfcontents co LEFT JOIN virtualshelves sh USING (shelfnumber)
SET co.borrowernumber=sh.owner;

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,
        CONSTRAINT `virtualshelfshares_ibfk_2` FOREIGN KEY (`borrowernumber`)
REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET
NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('OpacAllowPublicListCreation',1,'If set, allows opac users to create
public lists',NULL,'YesNo');
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');

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list