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
This commit is contained in:
mindless committed 2010-04-30 20:16:54 +00:00
1 parent 5974981064
commit cd8376e9b4
3 files changed
+13 -16

No files matched your search

@@ -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();
}