From cd8376e9b407bf72f41a90eae677f213e137ce93 Mon Sep 17 00:00:00 2001 From: mindless Date: Fri, 30 Apr 2010 20:16:54 +0000 Subject: [PATCH] In editableDescription for test results, invalid variable reference for permission attribute made the add/edit description link show up for all users, even if they don't have permission to submit the description. Fixed this so link is omitted when appropriate. Also changed permission required to add/edit a description from "Build" to "Update Run". git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@30575 71c3de6d-444a-0410-be80-ed276b4c234a --- .../src/main/java/hudson/tasks/test/TestObject.java | 13 +++++-------- .../hudson/tasks/junit/CaseResult/index.jelly | 8 ++++---- .../hudson/tasks/test/TestResult/index.jelly | 8 ++++---- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/hudson/tasks/test/TestObject.java b/core/src/main/java/hudson/tasks/test/TestObject.java index 03ae2c5914..529a437c55 100644 --- a/core/src/main/java/hudson/tasks/test/TestObject.java +++ b/core/src/main/java/hudson/tasks/test/TestObject.java @@ -1,7 +1,8 @@ /* * The MIT License * - * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Tom Huybrechts, Yahoo!, Inc. + * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, + * Tom Huybrechts, Yahoo!, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -398,13 +399,9 @@ public abstract class TestObject extends hudson.tasks.junit.TestObject { ServletException { if (getOwner() == null) { LOGGER.severe("getOwner() is null, can't save description."); - } - if (getOwner() != null) { - getOwner().checkPermission(Item.BUILD); - } - - setDescription(description); - if (getOwner() != null) { + } else { + getOwner().checkPermission(Run.UPDATE); + setDescription(description); getOwner().save(); } diff --git a/core/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly b/core/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly index 19864c5f2f..11d978d2c9 100644 --- a/core/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly +++ b/core/src/main/resources/hudson/tasks/junit/CaseResult/index.jelly @@ -53,19 +53,19 @@ THE SOFTWARE. -
+
${%took(it.durationString)} -
+
- + -
+

${%Error Message}

diff --git a/core/src/main/resources/hudson/tasks/test/TestResult/index.jelly b/core/src/main/resources/hudson/tasks/test/TestResult/index.jelly index 6f94983db2..b3e190c989 100644 --- a/core/src/main/resources/hudson/tasks/test/TestResult/index.jelly +++ b/core/src/main/resources/hudson/tasks/test/TestResult/index.jelly @@ -32,19 +32,19 @@ THE SOFTWARE. - - + -
+