mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
Hudson's permission group should be the first in the list.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14269 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
d0213f18e5
commit
ef880cf140
2 files changed
+31
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package hudson.security;
|
||||
|
||||
import hudson.CopyOnWrite;
|
||||
import hudson.model.Hudson;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
@@ -69,9 +70,21 @@ public final class PermissionGroup implements Iterable<Permission>, Comparable<P
|
||||
}
|
||||
|
||||
public int compareTo(PermissionGroup that) {
|
||||
// first, sort by the 'compare order' number. This is so that
|
||||
// we can put Hudson.PERMISSIONS first.
|
||||
int r= this.compareOrder()-that.compareOrder();
|
||||
if(r!=0) return r;
|
||||
|
||||
// among the permissions of the same group, just sort by their names
|
||||
// so that the sort order is consistent regardless of classloading order.
|
||||
return this.owner.getName().compareTo(that.owner.getName());
|
||||
}
|
||||
|
||||
private int compareOrder() {
|
||||
if(owner== Hudson.class) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return permisisons.size();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user