2 INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
3 (13, 'upload_general_files', 'Upload any file'),
4 (13, 'upload_manage', 'Manage uploaded files');
6 -- Update user_permissions for current users (check count in uploaded_files)
7 -- Note 9 == edit_catalogue and 13 == tools
8 -- We do not insert if someone is superlibrarian, does not have edit_catalogue,
9 -- or already has all tools
10 INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
11 SELECT borrowernumber, 13, 'upload_general_files'
13 WHERE flags<>1 AND flags & POW(2,13) = 0 AND
14 ( flags & POW(2,9) > 0 OR (
15 SELECT COUNT(*) FROM user_permissions
16 WHERE borrowernumber=bo.borrowernumber AND module_bit=9 ) > 0 )
17 AND ( SELECT COUNT(*) FROM uploaded_files ) > 0
19 # Copy-paste for RM use:
20 # print "Upgrade to $DBversion done (Bug 14686 - New menu option and permission for file uploading)\n";