Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "[JENKINS-16502] Permission to see an executor/slave"
This reverts commit 647695e.
  • Loading branch information
jglick committed Sep 27, 2013
1 parent bfa4f4f commit 3911ea2
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 21 deletions.
3 changes: 0 additions & 3 deletions changelog.html
Expand Up @@ -66,9 +66,6 @@ <h3><a name=v1.533>What's new in 1.533</a> <!--=DATE=--></h3>
<li class=rfe>
Offer alternate error message for pattern-based project naming strategy.
(<a href="https://github.com/jenkinsci/jenkins/pull/914">pull request 914</a>)
<li class=rfe>
Add support for hiding build slaves from users.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16502">issue 16502</a>)
</ul>
</div><!--=END=-->
<h3><a name=v1.532>What's new in 1.532</a> (2013/09/23)</h3>
Expand Down
4 changes: 0 additions & 4 deletions core/src/main/java/hudson/model/Computer.java
Expand Up @@ -1373,10 +1373,6 @@ public boolean accept(File dir, String name) {
public static final Permission DISCONNECT = new Permission(PERMISSIONS,"Disconnect", Messages._Computer_DisconnectPermission_Description(), Jenkins.ADMINISTER, PermissionScope.COMPUTER);
public static final Permission CONNECT = new Permission(PERMISSIONS,"Connect", Messages._Computer_ConnectPermission_Description(), DISCONNECT, PermissionScope.COMPUTER);
public static final Permission BUILD = new Permission(PERMISSIONS, "Build", Messages._Computer_BuildPermission_Description(), Permission.WRITE, PermissionScope.COMPUTER);
/**
* @since 1.533
*/
public static final Permission VIEW = new Permission(PERMISSIONS, "View", Messages._Computer_ViewPermission_Description(), Permission.READ, PermissionScope.COMPUTER);

private static final Logger LOGGER = Logger.getLogger(Computer.class.getName());
}
9 changes: 2 additions & 7 deletions core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -1533,12 +1533,7 @@ public boolean isUpgradedFromBefore(VersionNumber v) {
* Gets the read-only list of all {@link Computer}s.
*/
public Computer[] getComputers() {
Collection<Computer> computers = new ArrayList<Computer>(this.computers.size());
for (Computer c: this.computers.values()) {
if (c.hasPermission(Computer.VIEW))
computers.add(c);
}
Computer[] r = computers.toArray(new Computer[computers.size()]);
Computer[] r = computers.values().toArray(new Computer[computers.size()]);
Arrays.sort(r,new Comparator<Computer>() {
final Collator collator = Collator.getInstance();
public int compare(Computer lhs, Computer rhs) {
Expand All @@ -1557,7 +1552,7 @@ public Computer getComputer(@Argument(required=true,metaVar="NAME",usage="Node n

for (Computer c : computers.values()) {
if(c.getName().equals(name))
return c.hasPermission(Computer.VIEW) ? c : null;
return c;
}
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/hudson/model/Computer/builds.jelly
Expand Up @@ -24,7 +24,7 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${it.displayName}" permission="${it.VIEW}">
<l:layout title="${it.displayName}">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/hudson/model/Computer/delete.jelly
Expand Up @@ -24,7 +24,7 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout permission="${it.DELETE}">
<l:layout>
<st:include page="sidepanel.jelly" />
<l:main-panel>
<form method="post" action="doDelete">
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/hudson/model/Computer/index.jelly
Expand Up @@ -24,7 +24,7 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${it.displayName}" permission="${it.VIEW}">
<l:layout title="${it.displayName}">
<st:include page="sidepanel.jelly" />
<l:main-panel>

Expand Down
Expand Up @@ -24,7 +24,7 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${it.displayName} Load Statistics" permission="${it.VIEW}">
<l:layout title="${it.displayName} Load Statistics">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<st:include page="main.jelly" from="${it.loadStatistics}" />
Expand Down
Expand Up @@ -24,7 +24,7 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${%title(it.displayName)}" norefresh="true" permission="${it.VIEW}">
<l:layout title="${%title(it.displayName)}" norefresh="true">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<l:hasPermission permission="${it.DISCONNECT}">
Expand Down
Expand Up @@ -24,7 +24,7 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${%title(it.displayName)}" norefresh="true" permission="${it.VIEW}">
<l:layout title="${%title(it.displayName)}" norefresh="true">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<l:hasPermission permission="${it.DISCONNECT}">
Expand Down
1 change: 0 additions & 1 deletion core/src/main/resources/hudson/model/Messages.properties
Expand Up @@ -109,7 +109,6 @@ Computer.CreatePermission.Description=This permission allows users to create sla
Computer.ConnectPermission.Description=This permission allows users to connect slaves or mark slaves as online.
Computer.DisconnectPermission.Description=This permission allows users to disconnect slaves or mark slaves as temporarily offline.
Computer.BuildPermission.Description=This permission allows users to run jobs as them on slaves.
Computer.ViewPermission.Description=This permission allows users to see the slaves.
Computer.BadChannel=Slave node offline or not a remote channel (such as master node).

ComputerSet.NoSuchSlave=No such slave: {0}
Expand Down

0 comments on commit 3911ea2

Please sign in to comment.