api-viewer: do not show permission for backup/restore protocol
Permission check is done before the H2 upgrade.
This commit is contained in:
		@ -370,29 +370,31 @@ Ext.onReady(function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		var permhtml = '';
 | 
							if (!data.path.match(/\/_upgrade_/)) {
 | 
				
			||||||
		if (!info.permissions) {
 | 
							    var permhtml = '';
 | 
				
			||||||
		    permhtml = "Root only.";
 | 
					
 | 
				
			||||||
		} else {
 | 
							    if (!info.permissions) {
 | 
				
			||||||
		    if (info.permissions.description) {
 | 
								permhtml = "Root only.";
 | 
				
			||||||
			permhtml += "<div style='white-space:pre-wrap;padding-bottom:10px;'>" +
 | 
							    } else {
 | 
				
			||||||
			    Ext.htmlEncode(info.permissions.description) + "</div>";
 | 
								if (info.permissions.description) {
 | 
				
			||||||
 | 
								    permhtml += "<div style='white-space:pre-wrap;padding-bottom:10px;'>" +
 | 
				
			||||||
 | 
									Ext.htmlEncode(info.permissions.description) + "</div>";
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								permhtml += permission_text(info.permissions);
 | 
				
			||||||
		    }
 | 
							    }
 | 
				
			||||||
		    permhtml += permission_text(info.permissions);
 | 
					
 | 
				
			||||||
 | 
							    // we do not have this information for PBS api
 | 
				
			||||||
 | 
							    //if (!info.allowtoken) {
 | 
				
			||||||
 | 
							    //    permhtml += "<br />This API endpoint is not available for API tokens."
 | 
				
			||||||
 | 
							    //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							    sections.push({
 | 
				
			||||||
 | 
								title: 'Required permissions',
 | 
				
			||||||
 | 
								bodyPadding: 10,
 | 
				
			||||||
 | 
								html: permhtml
 | 
				
			||||||
 | 
							    });
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// we do not have this information for PBS api
 | 
					 | 
				
			||||||
		//if (!info.allowtoken) {
 | 
					 | 
				
			||||||
		//    permhtml += "<br />This API endpoint is not available for API tokens."
 | 
					 | 
				
			||||||
		//}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		sections.push({
 | 
					 | 
				
			||||||
		    title: 'Required permissions',
 | 
					 | 
				
			||||||
		    bodyPadding: 10,
 | 
					 | 
				
			||||||
		    html: permhtml
 | 
					 | 
				
			||||||
		});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		items.push({
 | 
							items.push({
 | 
				
			||||||
		    title: method,
 | 
							    title: method,
 | 
				
			||||||
		    autoScroll: true,
 | 
							    autoScroll: true,
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user