wrap canShare so we can also limit it to views that work

This commit is contained in:
j 2023-08-04 14:28:42 +02:00
parent f2ad63143a
commit a8d906743a
4 changed files with 15 additions and 7 deletions

View File

@ -73,13 +73,14 @@
"canSeeAccessed": {"researcher": true, "staff": true, "admin": true},
"canSeeAllTasks": {"staff": true, "admin": true},
"canSeeDebugMenu": {"researcher": true, "staff": true, "admin": true},
"canSeeExtraItemViews": {"researcher": true, "staff": true, "admin": true},
"canSeeMedia": {"researcher": true, "staff": true, "admin": true},
"canSeeDocument": {"guest": 1, "member": 1, "researcher": 2, "staff": 3, "admin": 3},
"canSeeExtraItemViews": {"researcher": true, "staff": true, "admin": true},
"canSeeItem": {"guest": 2, "member": 2, "researcher": 2, "staff": 3, "admin": 3},
"canSeeMedia": {"researcher": true, "staff": true, "admin": true},
"canSeeSize": {"researcher": true, "staff": true, "admin": true},
"canSeeSoftwareVersion": {"researcher": true, "staff": true, "admin": true},
"canSendMail": {"staff": true, "admin": true}
"canSendMail": {"staff": true, "admin": true},
"canShare": {"staff": true, "admin": true}
},
/*
"clipKeys" are the properties that clips can be sorted by (the values are

View File

@ -71,13 +71,14 @@
"canSeeAccessed": {"staff": true, "admin": true},
"canSeeAllTasks": {"staff": true, "admin": true},
"canSeeDebugMenu": {"staff": true, "admin": true},
"canSeeExtraItemViews": {"staff": true, "admin": true},
"canSeeMedia": {"staff": true, "admin": true},
"canSeeDocument": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canSeeExtraItemViews": {"staff": true, "admin": true},
"canSeeItem": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canSeeMedia": {"staff": true, "admin": true},
"canSeeSize": {"staff": true, "admin": true},
"canSeeSoftwareVersion": {"staff": true, "admin": true},
"canSendMail": {"staff": true, "admin": true}
"canSendMail": {"staff": true, "admin": true},
"canShare": {"staff": true, "admin": true}
},
/*
"clipKeys" are the properties that clips can be sorted by (the values are

View File

@ -1912,7 +1912,7 @@ pandora.ui.mainMenu = function() {
] },
{},
{ id: 'embed', title: Ox._('Embed...') },
{ id: 'share', title: Ox._('Share...'), disabled: isGuest }
{ id: 'share', title: Ox._('Share...'), disabled: !pandora.canShareView() }
]}
}

View File

@ -330,6 +330,12 @@ pandora.beforeUnloadWindow = function() {
pandora.isUnloading = true;
};
pandora.canShareView = function() {
return pandora.hasCapability('canShare')
};
pandora.changeFolderItemStatus = function(id, status, callback) {
var ui = pandora.user.ui,
folderItems = pandora.getFolderItems(ui.section),