提交 de14777e 编写于 作者: O Olivier Lamy

Merge pull request #490 from recampbell/master

Use Jenkins.RUN_SCRIPTS instead of Jenkins.ADMINISTER
......@@ -58,7 +58,7 @@ public class GroovyshCommand extends CLICommand {
@Override
public int main(List<String> args, Locale locale, InputStream stdin, PrintStream stdout, PrintStream stderr) {
// this allows the caller to manipulate the JVM state, so require the admin privilege.
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS);
// TODO: ^as this class overrides main() (which has authentication stuff),
// how to get ADMIN permission for this command?
......
......@@ -99,7 +99,7 @@ public final class MavenProbeAction implements Action {
public void doScript( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
// ability to run arbitrary script is dangerous,
// so tie it to the admin access
owner.checkPermission(Jenkins.ADMINISTER);
owner.checkPermission(Jenkins.RUN_SCRIPTS);
String text = req.getParameter("script");
if(text!=null) {
......
......@@ -29,7 +29,9 @@ THE SOFTWARE.
<l:task icon="images/24x24/document.gif" href="systemProperties" title="${%System Properties}" />
<l:task icon="images/24x24/document.gif" href="envVars" title="${%Environment Variables}" />
<l:task icon="images/24x24/document.gif" href="threads" title="${%Thread Dump}" />
<l:task icon="images/24x24/notepad.gif" href="script" title="${%Script Console}" />
<l:hasPermission permission="${app.RUN_SCRIPTS}">
<l:task icon="images/24x24/notepad.gif" href="script" title="${%Script Console}" />
</l:hasPermission>
</l:tasks>
</l:side-panel>
</j:jelly>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册