From db2d37e2bb79aeaef8dc21602de0dded40b0624b Mon Sep 17 00:00:00 2001 From: j Date: Sat, 4 Nov 2017 11:53:27 +0200 Subject: [PATCH] use pandora.hasCapability --- static/js/addItemDialog.js | 2 +- static/js/clipList.js | 2 +- static/js/collection.js | 2 +- static/js/documentInfoView.js | 6 +++--- static/js/documentsDialog.js | 2 +- static/js/documentsPanel.js | 2 +- static/js/editPanel.js | 2 +- static/js/editor.js | 6 +++--- static/js/embed/pandora.js | 6 +++--- static/js/entityDialog.js | 2 +- static/js/errorDialog.js | 2 +- static/js/findElement.js | 2 +- static/js/folderList.js | 2 +- static/js/folders.js | 2 +- static/js/groupsDialog.js | 2 +- static/js/info.js | 2 +- static/js/infoView.0xdb.js | 6 +++--- static/js/infoView.indiancinema.js | 8 ++++---- static/js/infoView.js | 6 +++--- static/js/infoView.padma.js | 6 +++--- static/js/item.js | 2 +- static/js/itemClips.js | 2 +- static/js/list.js | 2 +- static/js/mediaView.js | 2 +- static/js/navigationView.js | 2 +- static/js/news.js | 2 +- static/js/player.js | 2 +- static/js/siteDialog.0xdb.js | 4 ++-- static/js/siteDialog.js | 4 ++-- static/js/tasksDialog.js | 4 +--- static/js/uploadVideoDialog.js | 4 +--- static/js/viewSelect.js | 2 +- 32 files changed, 49 insertions(+), 53 deletions(-) diff --git a/static/js/addItemDialog.js b/static/js/addItemDialog.js index 1798d0471..d2b2ec362 100644 --- a/static/js/addItemDialog.js +++ b/static/js/addItemDialog.js @@ -45,7 +45,7 @@ pandora.ui.addItemDialog = function(options) { { id: 'import', title: Ox._('Import Video Files'), - disabled: !pandora.site.capabilities.canImportItems[pandora.user.level], + disabled: !pandora.hasCapability('canImportItems'), selected: selected == 'import' } ] diff --git a/static/js/clipList.js b/static/js/clipList.js index 578794cf5..260d25769 100644 --- a/static/js/clipList.js +++ b/static/js/clipList.js @@ -213,7 +213,7 @@ pandora.ui.clipList = function(videoRatio) { pandora.api.get({id: item, keys: ['durations', 'rightslevel', 'streams']}, function(result) { var points = [that.value(id, 'in'), that.value(id, 'out')], $player = Ox.VideoPlayer({ - censored: pandora.site.capabilities.canPlayClips[pandora.user.level] < result.data.rightslevel + censored: pandora.hasCapability('canPlayClips') < result.data.rightslevel ? [{'in': 0, out: points[1] - points[0]}] : [], censoredIcon: pandora.site.cantPlay.icon, diff --git a/static/js/collection.js b/static/js/collection.js index 8eb74f9b6..0a64032d5 100644 --- a/static/js/collection.js +++ b/static/js/collection.js @@ -29,7 +29,7 @@ pandora.ui.collection = function() { unique: 'id', columns: pandora.site.documentSortKeys.filter(function(key) { return !key.capability - || pandora.site.capabilities[key.capability][pandora.user.level]; + || pandora.hasCapability(key.capability); }).map(function(key) { var position = ui.collectionColumns.indexOf(key.id); return { diff --git a/static/js/documentInfoView.js b/static/js/documentInfoView.js index e2f06af5b..99da3df5e 100644 --- a/static/js/documentInfoView.js +++ b/static/js/documentInfoView.js @@ -3,8 +3,8 @@ pandora.ui.documentInfoView = function(data) { var ui = pandora.user.ui, - canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level] || data.editable, - canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level], + canEdit = pandora.hasCapability('canEditMetadata') || data.editable, + canRemove = pandora.hasCapability('canRemoveItems'), css = { marginTop: '4px', textAlign: 'justify' @@ -485,7 +485,7 @@ pandora.ui.documentInfoView = function(data) { .appendTo($line); } capabilities.forEach(function(capability) { - var hasCapability = pandora.site.capabilities[capability.name][userLevel] >= rightsLevel, + var hasCapability = pandora.hasCapability(capability.name, userLevel) >= rightsLevel, $element = Ox.Theme.formatColorLevel(hasCapability, ['', '']); Ox.Button({ tooltip: (canEdit ? Ox.toTitleCase(userLevel) : 'You') + ' ' diff --git a/static/js/documentsDialog.js b/static/js/documentsDialog.js index d7b380333..e6f2f8620 100644 --- a/static/js/documentsDialog.js +++ b/static/js/documentsDialog.js @@ -10,7 +10,7 @@ pandora.ui.documentsDialog = function() { // FIXME: user may not have the manage entites capability $switchButton = Ox.Button({ disabled: !pandora.site.entities.length - || !pandora.site.capabilities.canManageEntities[pandora.user.level], + || !pandora.hasCapability('canManageEntities'), title: Ox._('Manage Entities...') }) .bindEvent({ diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index 24d84ff28..9044307a2 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -576,7 +576,7 @@ pandora.ui.documentsPanel = function(options) { var $name, $description, $input, item = $list.value($list.options('selected')[0]), editable = item.user == pandora.user.username - || pandora.site.capabilities.canEditDocuments[pandora.user.level] + || pandora.hasCapability('canEditDocuments') || options.editable, labelWidth = 80, width = ui.documentSize - 16 - Ox.UI.SCROLLBAR_SIZE; diff --git a/static/js/editPanel.js b/static/js/editPanel.js index bf0d0ff01..874bab56f 100644 --- a/static/js/editPanel.js +++ b/static/js/editPanel.js @@ -413,7 +413,7 @@ pandora.ui.editPanel = function(isEmbed) { var $content = Ox.Element() .css({padding: '16px'}) .appendTo(that), - isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level]; + isEditable = pandora.hasCapability('canEditSitePages'); Ox.EditableContent({ editable: false, value: Ox._('{0} Edits', [pandora.site.site.name]), diff --git a/static/js/editor.js b/static/js/editor.js index 1a8687d92..3aaeca42d 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -20,9 +20,9 @@ pandora.ui.editor = function(data) { clickLink: pandora.clickLink, cuts: data.cuts || [], duration: data.duration, - enableDownload: pandora.site.capabilities.canDownloadVideo[pandora.user.level] >= data.rightslevel || data.editable, - enableExport: pandora.site.capabilities.canExportAnnotations[pandora.user.level] || data.editable, - enableImport: pandora.site.capabilities.canImportAnnotations[pandora.user.level] || data.editable, + enableDownload: pandora.hasCapability('canDownloadVideo') >= data.rightslevel || data.editable, + enableExport: pandora.hasCapability('canExportAnnotations') || data.editable, + enableImport: pandora.hasCapability('canImportAnnotations') || data.editable, enableSetPosterFrame: !pandora.site.media.importFrames && data.editable, enableSubtitles: ui.videoSubtitles, find: ui.itemFind, diff --git a/static/js/embed/pandora.js b/static/js/embed/pandora.js index 574e516c0..ee225f3c2 100755 --- a/static/js/embed/pandora.js +++ b/static/js/embed/pandora.js @@ -190,8 +190,8 @@ Ox.load('UI', { }); function getVideoOptions(data) { - var canPlayClips = data.editable || pandora.site.capabilities.canPlayClips[pandora.user.level] >= data.rightslevel, - canPlayVideo = data.editable || pandora.site.capabilities.canPlayVideo[pandora.user.level] >= data.rightslevel, + var canPlayClips = data.editable || pandora.hasCapability('canPlayClips') >= data.rightslevel, + canPlayVideo = data.editable || pandora.hasCapability('canPlayVideo') >= data.rightslevel, options = {}, subtitlesLayer = pandora.site.layers.filter(function(layer) { return layer.isSubtitles; @@ -226,7 +226,7 @@ Ox.load('UI', { annotation.duration = Math.abs(annotation.out - annotation['in']); annotation.editable = annotation.editable || annotation.user == pandora.user.username - || pandora.site.capabilities['canEditAnnotations'][pandora.user.level]; + || pandora.hasCapability('canEditAnnotations'); return annotation; }) }); diff --git a/static/js/entityDialog.js b/static/js/entityDialog.js index 047d6c65b..fcd19b1a4 100644 --- a/static/js/entityDialog.js +++ b/static/js/entityDialog.js @@ -10,7 +10,7 @@ pandora.ui.entityDialog = function() { .css({overflowY: 'auto'}), that = Ox.Dialog({ - buttons: (pandora.site.capabilities.canManageEntities[pandora.user.level] ? [ + buttons: (pandora.hasCapability('canManageEntities') ? [ Ox.Button({ id: 'edit', title: Ox._('Edit Entity...') diff --git a/static/js/errorDialog.js b/static/js/errorDialog.js index 1a83f84d4..af9094775 100644 --- a/static/js/errorDialog.js +++ b/static/js/errorDialog.js @@ -38,7 +38,7 @@ pandora.ui.errorDialog = function(data) { setTimeout(function() { if ($('.OxErrorDialog').length == 0 && !pandora.isUnloading) { showLogsButton = error == 'error' - && pandora.site.capabilities.canSeeDebugMenu[pandora.user.level] + && pandora.hasCapability('canSeeDebugMenu') that = pandora.ui.iconDialog({ buttons: (showLogsButton ? [ Ox.Button({ diff --git a/static/js/findElement.js b/static/js/findElement.js index 1581bc778..374395348 100644 --- a/static/js/findElement.js +++ b/static/js/findElement.js @@ -35,7 +35,7 @@ pandora.ui.findElement = function() { items: [].concat( pandora.site.findKeys.filter(function(key, i) { return (!key.capability - || pandora.site.capabilities[key.capability][pandora.user.level]) + || pandora.hasCapability(key.capability)) && !key.advanced; }).map(function(key) { return { diff --git a/static/js/folderList.js b/static/js/folderList.js index 1ab4ca0bf..342f7e61d 100644 --- a/static/js/folderList.js +++ b/static/js/folderList.js @@ -7,7 +7,7 @@ pandora.ui.folderList = function(id, section) { i = Ox.getIndexById(pandora.site.sectionFolders[section], id), folderItems = pandora.getFolderItems(section), folderItem = folderItems.slice(0, -1), - canEditFeatured = pandora.site.capabilities['canEditFeatured' + folderItems][pandora.user.level], + canEditFeatured = pandora.hasCapability('canEditFeatured' + folderItems), $placeholder, that; var columns, items; diff --git a/static/js/folders.js b/static/js/folders.js index 853d03cf3..3f9e776c6 100644 --- a/static/js/folders.js +++ b/static/js/folders.js @@ -18,7 +18,7 @@ pandora.ui.folders = function(section) { }[section]] || '').split(':')[0] == pandora.user.username, folderItems = pandora.getFolderItems(section), folderItem = folderItems.slice(0, -1), - canEditFeatured = pandora.site.capabilities['canEditFeatured' + folderItems][pandora.user.level], + canEditFeatured = pandora.hasCapability('canEditFeatured' + folderItems), initCounter = 0, loadCounter = 0; pandora.$ui.allItems = pandora.ui.allItems(section).appendTo(that); diff --git a/static/js/groupsDialog.js b/static/js/groupsDialog.js index ec916bda7..15064887c 100644 --- a/static/js/groupsDialog.js +++ b/static/js/groupsDialog.js @@ -21,7 +21,7 @@ pandora.ui.groupsDialog = function(options) { width: 584 + Ox.UI.SCROLLBAR_SIZE }), - canManageGroups = pandora.site.capabilities.canManageUsers[pandora.user.level], + canManageGroups = pandora.hasCapability('canManageUsers'), isItem = options.type == 'item', $content, diff --git a/static/js/info.js b/static/js/info.js index 1fe902e33..b8349e5a8 100644 --- a/static/js/info.js +++ b/static/js/info.js @@ -215,7 +215,7 @@ pandora.ui.listInfo = function() { : pandora.user.ui.section == 'documents' ? pandora.user.ui._collection : ui[folderItem.toLowerCase()], - canEditFeaturedLists = pandora.site.capabilities['canEditFeatured' + folderItems][pandora.user.level], + canEditFeaturedLists = pandora.hasCapability('canEditFeatured' + folderItems), that = Ox.Element().css({padding: '16px', textAlign: 'center'}), $icon = Ox.Element('') .attr({ diff --git a/static/js/infoView.0xdb.js b/static/js/infoView.0xdb.js index a9610326e..ee7f1d6c7 100644 --- a/static/js/infoView.0xdb.js +++ b/static/js/infoView.0xdb.js @@ -6,8 +6,8 @@ pandora.ui.infoView = function(data) { // when collapsing the movies browser, the info view should become a split panel var ui = pandora.user.ui, - canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level], - canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level], + canEdit = pandora.hasCapability('canEditMetadata'), + canRemove = pandora.hasCapability('canRemoveItems'), canSeeAllMetadata = pandora.user.level != 'guest', css = { marginTop: '4px', @@ -859,7 +859,7 @@ pandora.ui.infoView = function(data) { .appendTo($line); } capabilities.forEach(function(capability) { - var hasCapability = pandora.site.capabilities[capability.name][userLevel] >= rightsLevel, + var hasCapability = pandora.hasCapability(capability.name, userLevel) >= rightsLevel, $element = Ox.Theme.formatColorLevel(hasCapability, ['', '']); Ox.Button({ tooltip: (canEdit ? Ox.toTitleCase(userLevel) : 'You') + ' ' diff --git a/static/js/infoView.indiancinema.js b/static/js/infoView.indiancinema.js index 0ea6db714..28f33fe0a 100644 --- a/static/js/infoView.indiancinema.js +++ b/static/js/infoView.indiancinema.js @@ -3,8 +3,8 @@ pandora.ui.infoView = function(data) { var ui = pandora.user.ui, - canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level], - canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level], + canEdit = pandora.hasCapability('canEditMetadata'), + canRemove = pandora.hasCapability('canRemoveItems'), canSeeAllMetadata = pandora.user.level != 'guest', css = { marginTop: '4px', @@ -65,7 +65,7 @@ pandora.ui.infoView = function(data) { { id: 'upload', title: Ox._('Upload Video...'), - disabled: !pandora.site.capabilities.canAddItems[pandora.user.level] + disabled: !pandora.hasCapability('canAddItems') }, {}, { @@ -904,7 +904,7 @@ pandora.ui.infoView = function(data) { .appendTo($line); } capabilities.forEach(function(capability) { - var hasCapability = pandora.site.capabilities[capability.name][userLevel] >= rightsLevel, + var hasCapability = pandora.hasCapability(capability.name, userLevel) >= rightsLevel, $element = Ox.Theme.formatColorLevel(hasCapability, ['', '']); Ox.Button({ tooltip: Ox._('{0} ' diff --git a/static/js/infoView.js b/static/js/infoView.js index 4bf04bce5..1628681d0 100644 --- a/static/js/infoView.js +++ b/static/js/infoView.js @@ -4,8 +4,8 @@ pandora.ui.infoView = function(data) { var ui = pandora.user.ui, descriptions = [], - canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level] || data.editable, - canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level], + canEdit = pandora.hasCapability('canEditMetadata') || data.editable, + canRemove = pandora.hasCapability('canRemoveItems'), css = { marginTop: '4px', textAlign: 'justify' @@ -495,7 +495,7 @@ pandora.ui.infoView = function(data) { .appendTo($line); } capabilities.forEach(function(capability) { - var hasCapability = pandora.site.capabilities[capability.name][userLevel] >= rightsLevel, + var hasCapability = pandora.hasCapability(capability.name, userLevel) >= rightsLevel, $element = Ox.Theme.formatColorLevel(hasCapability, ['', '']); Ox.Button({ tooltip: (canEdit ? Ox.toTitleCase(userLevel) : 'You') + ' ' diff --git a/static/js/infoView.padma.js b/static/js/infoView.padma.js index 1a9faf807..66167e681 100644 --- a/static/js/infoView.padma.js +++ b/static/js/infoView.padma.js @@ -3,8 +3,8 @@ pandora.ui.infoView = function(data) { var ui = pandora.user.ui, - canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level] || data.editable, - canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level] || data.editable, + canEdit = pandora.hasCapability('canEditMetadata') || data.editable, + canRemove = pandora.hasCapability('canRemoveItems') || data.editable, css = { marginTop: '4px', textAlign: 'justify' @@ -665,7 +665,7 @@ pandora.ui.infoView = function(data) { .appendTo($line); } capabilities.forEach(function(capability) { - var hasCapability = pandora.site.capabilities[capability.name][userLevel] >= rightsLevel, + var hasCapability = pandora.hasCapability(capability.name, userLevel) >= rightsLevel, $element = Ox.Theme.formatColorLevel(hasCapability, ['', '']); Ox.Button({ tooltip: Ox._('{0} ' diff --git a/static/js/item.js b/static/js/item.js index 13ced1637..b4a6c346b 100644 --- a/static/js/item.js +++ b/static/js/item.js @@ -13,7 +13,7 @@ pandora.ui.item = function() { pandora.api.get({ id: pandora.user.ui.item, keys: isVideoView ? Ox.unique(pandora.VIDEO_OPTIONS_KEYS.concat(pandora.site.itemTitleKeys)) : [] - }, pandora.user.ui.itemView == 'info' && pandora.site.capabilities.canEditMetadata[pandora.user.level] ? 0 : -1, function(result) { + }, pandora.user.ui.itemView == 'info' && pandora.hasCapability('canEditMetadata') ? 0 : -1, function(result) { if (pandora.user.ui.item != item) { return; diff --git a/static/js/itemClips.js b/static/js/itemClips.js index 071e033e1..899c63d33 100644 --- a/static/js/itemClips.js +++ b/static/js/itemClips.js @@ -100,7 +100,7 @@ pandora.ui.itemClips = function(options) { result.data.durations, points ), $player = Ox.VideoPlayer({ - censored: pandora.site.capabilities.canPlayClips[pandora.user.level] < result.data.rightslevel + censored: pandora.hasCapability('canPlayClips') < result.data.rightslevel ? [{'in': partsAndPoints.points[0], out: partsAndPoints.points[1]}] : [], enableMouse: true, diff --git a/static/js/list.js b/static/js/list.js index 5a05f534d..14a414a3d 100644 --- a/static/js/list.js +++ b/static/js/list.js @@ -55,7 +55,7 @@ pandora.ui.list = function() { width: 16 }], pandora.site.sortKeys.filter(function(key) { return !key.capability - || pandora.site.capabilities[key.capability][pandora.user.level]; + || pandora.hasCapability(key.capability); }).map(function(key) { var position = ui.listColumns.indexOf(key.id); return { diff --git a/static/js/mediaView.js b/static/js/mediaView.js index f270de10b..8630dc34d 100644 --- a/static/js/mediaView.js +++ b/static/js/mediaView.js @@ -4,7 +4,7 @@ pandora.ui.mediaView = function(options) { - var canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level] || options.editable, + var canRemove = pandora.hasCapability('canRemoveItems') || options.editable, self = {}, keys = ['title', 'director', 'year', 'id'], listKeys = keys.filter(function(key) { diff --git a/static/js/navigationView.js b/static/js/navigationView.js index 863283063..9cd4d4fac 100644 --- a/static/js/navigationView.js +++ b/static/js/navigationView.js @@ -122,7 +122,7 @@ pandora.ui.navigationView = function(type, videoRatio) { that.replaceElement(0, $element = Ox.Map({ - // clickable: pandora.site.capabilities.canClickMap[pandora.user.level], + // clickable: pandora.hasCapability('canClickMap'), find: ui.mapFind, // 20 px menu + 24 px toolbar + 1px resizbar + 16px statusbar (if !item) height: isEmbed ? window.innerHeight - 40 diff --git a/static/js/news.js b/static/js/news.js index d05932cea..504a01c72 100644 --- a/static/js/news.js +++ b/static/js/news.js @@ -12,7 +12,7 @@ pandora.ui.news = function(width, height) { backgroundColor = Ox.Theme() == 'oxlight' ? 'rgb(224, 224, 224)' : Ox.Theme() == 'oxmedium' ? 'rgb(128, 128, 128)' : 'rgb(32, 32, 32)', - isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level], + isEditable = pandora.hasCapability('canEditSitePages'), items = [], $text; diff --git a/static/js/player.js b/static/js/player.js index fca39c65d..ee6dfef4f 100644 --- a/static/js/player.js +++ b/static/js/player.js @@ -21,7 +21,7 @@ pandora.ui.player = function(data) { clickLink: pandora.clickLink, cuts: data.cuts || [], duration: data.duration, - enableDownload: pandora.site.capabilities.canDownloadVideo[pandora.user.level] >= data.rightslevel, + enableDownload: pandora.hasCapability('canDownloadVideo') >= data.rightslevel, enableSubtitles: ui.videoSubtitles, find: ui.itemFind, getLargeTimelineURL: function(type, i) { diff --git a/static/js/siteDialog.0xdb.js b/static/js/siteDialog.0xdb.js index 78f811802..102e3939e 100644 --- a/static/js/siteDialog.0xdb.js +++ b/static/js/siteDialog.0xdb.js @@ -4,10 +4,10 @@ pandora.ui.siteDialog = function(section) { - var canSeeVersion = pandora.site.capabilities.canSeeSoftwareVersion[pandora.user.level], + var canSeeVersion = pandora.hasCapability('canSeeSoftwareVersion'), dialogHeight = Math.round((window.innerHeight - 48) * 0.75), dialogWidth = Math.round(window.innerWidth * 0.75), - isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level], + isEditable = pandora.hasCapability('canEditSitePages'), tabs = Ox.clone(pandora.site.sitePages, true).map(function(page) { page.title = Ox._(page.title); return page; diff --git a/static/js/siteDialog.js b/static/js/siteDialog.js index b0cf91f86..cd29cf35d 100644 --- a/static/js/siteDialog.js +++ b/static/js/siteDialog.js @@ -4,10 +4,10 @@ pandora.ui.siteDialog = function(section) { - var canSeeVersion = pandora.site.capabilities.canSeeSoftwareVersion[pandora.user.level], + var canSeeVersion = pandora.hasCapability('canSeeSoftwareVersion'), dialogHeight = Math.round((window.innerHeight - 48) * 0.75), dialogWidth = Math.round(window.innerWidth * 0.75), - isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level], + isEditable = pandora.hasCapability('canEditSitePages'), tabs = Ox.clone(pandora.site.sitePages, true).map(function(page) { page.title = Ox._(page.title); return page; diff --git a/static/js/tasksDialog.js b/static/js/tasksDialog.js index 48dafd131..dc5ec8fd9 100644 --- a/static/js/tasksDialog.js +++ b/static/js/tasksDialog.js @@ -149,9 +149,7 @@ pandora.ui.tasksDialog = function(options) { ], width: 128 }).css({ - display: pandora.site.capabilities.canSeeAllTasks[ - pandora.user.level - ] ? 'block' : 'none', + display: pandora.hasCapability('canSeeAllTasks') ? 'block' : 'none', margin: '8px 4px 4px 4px' }).bindEvent({ change: function(data) { diff --git a/static/js/uploadVideoDialog.js b/static/js/uploadVideoDialog.js index f62a5f800..157cda8d5 100644 --- a/static/js/uploadVideoDialog.js +++ b/static/js/uploadVideoDialog.js @@ -9,9 +9,7 @@ pandora.ui.uploadVideoDialog = function(data) { $.browser.version < '35' || Firefogg().version >= 334 ), infoContent = Ox._('Please select the video file that you want to upload.'), - itemView = pandora.site.capabilities.canSeeExtraItemViews[ - pandora.user.level - ] ? 'media' : 'info', + itemView = pandora.hasCapability('canSeeExtraItemViews') ? 'media' : 'info', selectFile, $actionButton, $closeButton, diff --git a/static/js/viewSelect.js b/static/js/viewSelect.js index e487e2d1f..b61acf741 100644 --- a/static/js/viewSelect.js +++ b/static/js/viewSelect.js @@ -14,7 +14,7 @@ pandora.ui.viewSelect = function() { that; if ( viewKey == 'itemView' - && pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level] + && pandora.hasCapability('canSeeExtraItemViews') ) { items = items.concat([ {},