mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
Highlight when plugins have the adopt-this-plugin label
This commit is contained in:
1 parent
118fe330a2
commit
02d57f1dc4
5 files changed
+49
-3
No files matched your search
@@ -126,6 +126,7 @@ import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
@@ -2245,6 +2246,33 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
return this;
|
||||
}
|
||||
|
||||
@Restricted(DoNotUse.class) // Used from table.jelly
|
||||
public boolean isMetaLabel(String label) {
|
||||
return "adopt-this-plugin".equals(label);
|
||||
}
|
||||
|
||||
@Restricted(DoNotUse.class) // Used from table.jelly
|
||||
public boolean hasAdoptThisPluginLabel(UpdateSite.Plugin plugin) {
|
||||
final String[] categories = plugin.categories;
|
||||
if (categories == null) {
|
||||
return false;
|
||||
}
|
||||
return Arrays.asList(categories).contains("adopt-this-plugin");
|
||||
}
|
||||
|
||||
@Restricted(DoNotUse.class) // Used from table.jelly
|
||||
public boolean hasAdoptThisPluginLabel(PluginWrapper plugin) {
|
||||
final UpdateSite.Plugin pluginMeta = Jenkins.get().getUpdateCenter().getPlugin(plugin.getShortName());
|
||||
if (pluginMeta == null) {
|
||||
return false;
|
||||
}
|
||||
final String[] categories = pluginMeta.categories;
|
||||
if (categories == null) {
|
||||
return false;
|
||||
}
|
||||
return Arrays.asList(categories).contains("adopt-this-plugin");
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape hatch for StaplerProxy-based access control
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user