String id = request.getParameter("id");
PolicyUtil.checkPermission(PolicyConstants.EXTENSIONS_RESOURCE_TYPE,
PolicyConstants.PERM_CHANGE,
getSessionInfo(request).getUser());
ExtensionBundle bundle = ExtensionStore.getInstance().getExtensionBundle(id);
if (!bundle.canDisable()) {
throw new Exception("Bundle cannot be disabled.");
}
if (!bundle.isContainsPlugin()) {
bundle.stop();
}