提交 522ef37f 编写于 作者: K kohsuke

we need hasAbortPermission has well.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6585 71c3de6d-444a-0410-be80-ed276b4c234a
上级 4610b77e
......@@ -511,6 +511,10 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
checkPermission(AbstractProject.ABORT);
}
public boolean hasAbortPermission() {
return hasPermission(AbstractProject.ABORT);
}
/**
* Gets the {@link Resource} that represents the workspace of this project.
*/
......
......@@ -167,12 +167,7 @@ public class Executor extends Thread implements ModelObject {
* Checks if the current user has a permission to stop this build.
*/
public boolean hasStopPermission() {
try {
executable.getParent().checkAbortPermission();
return true;
} catch (AccessDeniedException e) {
return false;
}
return executable.getParent().hasAbortPermission();
}
public Computer getOwner() {
......
......@@ -587,6 +587,12 @@ public class Queue extends ResourceController {
* @throws AccessDeniedException if the permission is not granted.
*/
void checkAbortPermission();
/**
* Works just like {@link #checkAbortPermission()} except it indicates the status by a return value,
* instead of exception.
*/
boolean hasAbortPermission();
}
public interface Executable extends Runnable {
......@@ -694,12 +700,7 @@ public class Queue extends ResourceController {
}
public boolean hasCancelPermission() {
try {
task.checkAbortPermission();
return true;
} catch (AccessDeniedException e) {
return false;
}
return task.hasAbortPermission();
}
public int compareTo(Item that) {
......
......@@ -11,9 +11,9 @@
</td><td>
<t:buildProgressBar build="${it}"/>
</td><td>
<l:isAdmin>
<a href="stop"><img src="${imagesURL}/16x16/stop.gif" alt="[${%cancel}]" /></a>
</l:isAdmin>
<j:if test="${parent.}">
<a href="stop"><img src="${imagesURL}/16x16/stop.gif" alt="[${%cancel}]" /></a>
</j:if>
</td>
</tr></table>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册