Refine search
@Override public Object getTarget() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); return this; }
public void checkPermission(Permission permission) { Jenkins.getInstance().checkPermission(permission); }
@Override @Restricted(NoExternalUse.class) public Object getTarget() { if (!SKIP_PERMISSION_CHECK) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); } return this; }
@Override @Restricted(NoExternalUse.class) public Object getTarget() { if (!SKIP_PERMISSION_CHECK) { Jenkins.getInstance().checkPermission(Jenkins.READ); } return this; }
@Override @Restricted(NoExternalUse.class) public Object getTarget() { if (!SKIP_PERMISSION_CHECK) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); } return this; }
@Override @Restricted(NoExternalUse.class) public Object getTarget() { if (!SKIP_PERMISSION_CHECK) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); } return this; }
public Api getApi() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); return new Api(this); }
public Api getApi() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); return new Api(this); }
public HttpResponse doDownload() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); return HttpResponses.staticResource(file); }
@RequirePOST @Deprecated public HttpResponse doPin() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); // See https://groups.google.com/d/msg/jenkinsci-dev/kRobm-cxFw8/6V66uhibAwAJ LOGGER.log(WARNING, "Call to pin plugin has been ignored. Plugin name: " + shortName); return HttpResponses.ok(); }
@RequirePOST @Deprecated public HttpResponse doUnpin() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); // See https://groups.google.com/d/msg/jenkinsci-dev/kRobm-cxFw8/6V66uhibAwAJ LOGGER.log(WARNING, "Call to unpin plugin has been ignored. Plugin name: " + shortName); return HttpResponses.ok(); }
@RequirePOST public HttpResponse doDelete() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); file.delete(); owner.files.remove(this); return HttpResponses.redirectTo("../.."); } }
/** * Configure the logging level. */ @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE") @RequirePOST public HttpResponse doConfigLogger(@QueryParameter String name, @QueryParameter String level) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); Level lv; if(level.equals("inherit")) lv = null; else lv = Level.parse(level.toUpperCase(Locale.ENGLISH)); Logger.getLogger(name).setLevel(lv); return new HttpRedirect("levels"); }
/** * Invalidates the cached data and force retrieval. * * @since 1.432 */ @RequirePOST public HttpResponse doInvalidateData() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); dataTimestamp = 0; data = null; return HttpResponses.ok(); }
public synchronized void set(String newContent) throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); write(newContent); load2(); }
/** * Makes sure that the given name is good as an agent name. */ public FormValidation doCheckName(@QueryParameter String value) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Computer.CREATE); if(Util.fixEmpty(value)==null) return FormValidation.ok(); try { checkName(value); return FormValidation.ok(); } catch (Failure e) { return FormValidation.error(e.getMessage()); } }
/** * Checks if the home directory is valid. * @since 1.563 */ public FormValidation doCheckHome(@QueryParameter File value) { // this can be used to check the existence of a file on the server, so needs to be protected Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); if (value.getPath().isEmpty()) { return FormValidation.ok(); } if (!value.isDirectory()) { return FormValidation.warning(Messages.ToolDescriptor_NotADirectory(value)); } return checkHomeDirectory(value); }
/** * Snooze the upgrade wizard notice. */ @RequirePOST public HttpResponse doSnooze() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); File f = SetupWizard.getUpdateStateFile(); FileUtils.touch(f); f.setLastModified(System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1)); LOGGER.log(FINE, "Snoozed the upgrade wizard notice"); return HttpResponses.redirectToContextRoot(); }
/** * Call this to hide the upgrade wizard */ public HttpResponse doHideUpgradeWizard() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); HttpSession session = Stapler.getCurrentRequest().getSession(false); if(session != null) { session.removeAttribute(SHOW_UPGRADE_WIZARD_FLAG); } return HttpResponses.redirectToContextRoot(); }
/** * Call this to show the upgrade wizard */ public HttpResponse doShowUpgradeWizard() throws Exception { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); HttpSession session = Stapler.getCurrentRequest().getSession(true); session.setAttribute(SHOW_UPGRADE_WIZARD_FLAG, true); return HttpResponses.redirectToContextRoot(); }