本文整理了Java中hudson.model.Hudson.checkPermission()
方法的一些代码示例,展示了Hudson.checkPermission()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hudson.checkPermission()
方法的具体详情如下:
包路径:hudson.model.Hudson
类名称:Hudson
方法名:checkPermission
暂无
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* For binding {@link LogRecorderManager} to "/log".
* Everything below here is admin-only, so do the check here.
*/
public LogRecorderManager getLog() {
checkPermission(ADMINISTER);
return log;
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* For binding {@link LogRecorderManager} to "/log". Everything below here
* is admin-only, so do the check here.
*/
public LogRecorderManager getLog() {
checkPermission(ADMINISTER);
return log;
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public HttpResponse doPin() throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
new FileOutputStream(pinFile).close();
return HttpResponses.ok();
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
public HttpResponse doPin() throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
new FileOutputStream(pinFile).close();
return HttpResponses.ok();
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
public HttpResponse doPin() throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
new FileOutputStream(pinFile).close();
return HttpResponses.ok();
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public HttpResponse doUnpin() throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
pinFile.delete();
return HttpResponses.ok();
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* For debugging. Expose URL to perform GC.
*/
public void doGc(StaplerResponse rsp) throws IOException {
checkPermission(Hudson.ADMINISTER);
System.gc();
rsp.setStatus(HttpServletResponse.SC_OK);
rsp.setContentType("text/plain");
rsp.getWriter().println("GCed");
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
protected int run() throws Exception {
Hudson h = Hudson.getInstance();
h.checkPermission(Item.CREATE);
if (h.getItem(name)!=null) {
stderr.println("Job '"+name+"' already exists");
return -1;
}
h.createProjectFromXML(name,stdin);
return 0;
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
protected int run() throws Exception {
Hudson h = Hudson.getInstance();
h.checkPermission(Item.CREATE);
if (h.getItem(name)!=null) {
stderr.println("Job '"+name+"' already exists");
return -1;
}
h.createProjectFromXML(name,stdin);
return 0;
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public HttpResponse doMakeEnabled() throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
enable();
return HttpResponses.ok();
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public HttpResponse doMakeDisabled() throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
disable();
return HttpResponses.ok();
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
public HttpResponse doMakeEnabled() throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
enable();
return HttpResponses.ok();
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
public HttpResponse doMakeEnabled() throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
enable();
return HttpResponses.ok();
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* URL binding to disable this monitor.
*/
public void doDisable(StaplerRequest req, StaplerResponse rsp) throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
disable(true);
rsp.sendRedirect2(req.getContextPath()+"/manage");
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
@CLIMethod(name = "cancel-quiet-down")
public synchronized HttpRedirect doCancelQuietDown() {
checkPermission(ADMINISTER);
isQuietingDown = false;
getQueue().scheduleMaintenance();
return new HttpRedirect(".");
}
代码示例来源:origin: org.jenkins-ci.plugins/global-build-stats
public void doUpdateBuildStatConfiguration(StaplerRequest req, StaplerResponse res) throws ServletException, IOException {
Hudson.getInstance().checkPermission(getRequiredPermission());
boolean regenerateId = Boolean.valueOf(req.getParameter("regenerateId")).booleanValue();
BuildStatConfiguration config = FromRequestObjectFactory.createBuildStatConfiguration(req.getParameter("buildStatId"), req);
business.updateBuildStatConfiguration(req.getParameter("buildStatId"), config, regenerateId);
String json = JSONObject.fromObject(config).toString();
res.getWriter().write(json);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public void do_launchAll(StaplerRequest req, StaplerResponse rsp) throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
for(Computer c : get_all()) {
if(c.isLaunchSupported())
c.connect(true);
}
rsp.sendRedirect(".");
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
public void do_launchAll(StaplerRequest req, StaplerResponse rsp) throws IOException {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
for(Computer c : get_all()) {
if(c.isLaunchSupported())
c.connect(true);
}
rsp.sendRedirect(".");
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Schedules the downgrade of this plugin.
*/
public Future<UpdateCenterJob> deployBackup() {
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
UpdateCenter uc = Hudson.getInstance().getUpdateCenter();
return uc.addJob(uc.new PluginDowngradeJob(this, UpdateSite.this, HudsonSecurityManager.getAuthentication()));
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Accepts the update to the node configuration.
*/
public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
final Hudson app = Hudson.getInstance();
app.checkPermission(Hudson.ADMINISTER);
properties.rebuild(req, req.getSubmittedForm(), getApplicablePropertyDescriptors());
updateTransientActions();
save();
// take the user back to the label top page.
rsp.sendRedirect2(".");
}
内容来源于网络,如有侵权,请联系作者删除!