* [bug #56825, done, 0.3h] check priv before show api structs and release views.
This commit is contained in:
@@ -1316,16 +1316,18 @@ const customRenders =
|
||||
'sidebar-before': function()
|
||||
{
|
||||
if(!isApiLib()) return;
|
||||
const canViewStructs = docAppHasPriv('struct');
|
||||
const canViewReleases = docAppHasPriv('releases');
|
||||
if(!canViewStructs && !canViewReleases) return;
|
||||
|
||||
const isListMode = this.mode === 'list';
|
||||
const lang = getDocAppLang();
|
||||
const listType = this.signals.listType.value;
|
||||
const items = [
|
||||
{text: lang.struct, selected: listType === 'structs' && isListMode, icon: 'treemap muted', command: 'showStructs'},
|
||||
{type: 'divider', className: 'my-1'},
|
||||
{text: lang.releases, selected: listType === 'releases' && isListMode, icon: 'version muted', command: 'showReleases'},
|
||||
{type: 'divider', className: 'my-1'},
|
||||
{text: lang.module, icon: 'list muted', command: 'showModules'}
|
||||
];
|
||||
const lang = getDocAppLang();
|
||||
const listType = this.signals.listType.value;
|
||||
const items = [];
|
||||
if(canViewStructs) items.push({text: lang.struct, selected: listType === 'structs' && isListMode, icon: 'treemap muted', command: 'showStructs'}, {type: 'divider', className: 'my-1'});
|
||||
if(canViewReleases) items.push({text: lang.releases, selected: listType === 'releases' && isListMode, icon: 'version muted', command: 'showReleases'}, {type: 'divider', className: 'my-1'});
|
||||
items.push({text: lang.module, icon: 'list muted', command: 'showModules'});
|
||||
|
||||
return {
|
||||
component: 'tree',
|
||||
className: 'p-2 pb-0 api-lib-menu',
|
||||
|
||||
@@ -136,16 +136,18 @@ const customRenders =
|
||||
'sidebar-before': function()
|
||||
{
|
||||
if(!this.libID) return;
|
||||
|
||||
const canViewStructs = docAppHasPriv('struct');
|
||||
const canViewReleases = docAppHasPriv('releases');
|
||||
if(!canViewStructs && !canViewReleases) return;
|
||||
|
||||
const isListMode = this.mode === 'list';
|
||||
const lang = getDocAppLang();
|
||||
const listType = this.signals.listType.value;
|
||||
const items = [
|
||||
{text: lang.struct, selected: listType === 'structs' && isListMode, icon: 'treemap muted', command: 'showStructs'},
|
||||
{type: 'divider', className: 'my-1'},
|
||||
{text: lang.releases, selected: listType === 'releases' && isListMode, icon: 'version muted', command: 'showReleases'},
|
||||
{type: 'divider', className: 'my-1'},
|
||||
{text: lang.module, icon: 'list muted', command: 'showModules'}
|
||||
];
|
||||
const lang = getDocAppLang();
|
||||
const listType = this.signals.listType.value;
|
||||
const items = [];
|
||||
if(canViewStructs) items.push({text: lang.struct, selected: listType === 'structs' && isListMode, icon: 'treemap muted', command: 'showStructs'}, {type: 'divider', className: 'my-1'});
|
||||
if(canViewReleases) items.push({text: lang.releases, selected: listType === 'releases' && isListMode, icon: 'version muted', command: 'showReleases'}, {type: 'divider', className: 'my-1'});
|
||||
items.push({text: lang.module, icon: 'list muted', command: 'showModules'});
|
||||
return {
|
||||
component: 'tree',
|
||||
className: 'p-2 pb-0 api-lib-menu',
|
||||
|
||||
@@ -26,6 +26,8 @@ $privs['addModule'] = hasPriv('doc', 'addCatalog');
|
||||
$privs['deleteModule'] = hasPriv('doc', 'deleteCatalog');
|
||||
$privs['editModule'] = hasPriv('doc', 'editCatalog');
|
||||
$privs['sortModule'] = hasPriv('doc', 'sortCatalog');
|
||||
$privs['releases'] = hasPriv('api', 'releases');
|
||||
$privs['struct'] = hasPriv('api', 'struct');
|
||||
|
||||
docApp
|
||||
(
|
||||
|
||||
@@ -55,6 +55,8 @@ $privs['createApi'] = hasPriv('api', 'create');
|
||||
$privs['editApi'] = hasPriv('api', 'edit');
|
||||
$privs['createStruct'] = hasPriv('api', 'createStruct');
|
||||
$privs['createRelease']= hasPriv('api', 'createRelease');
|
||||
$privs['releases'] = hasPriv('api', 'releases');
|
||||
$privs['struct'] = hasPriv('api', 'struct');
|
||||
$privs['createOffice'] = true;
|
||||
|
||||
$homeName = false;
|
||||
|
||||
Reference in New Issue
Block a user