mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-30 13:05:19 +00:00
[FIXED JENKINS-19173] Added ContextMenuVisibility marker interface for Action’s.
This commit is contained in:
1 parent
549e23ba64
commit
dceac8f0ac
5 files changed
+144
-5
No files matched your search
@@ -153,6 +153,7 @@ import com.google.common.base.Predicates;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.DoNotUse;
|
||||
import org.kohsuke.accmod.restrictions.NoExternalUse;
|
||||
|
||||
/**
|
||||
* Utility functions used in views.
|
||||
@@ -1848,4 +1849,14 @@ public class Functions {
|
||||
rsp.setHeader("X-Jenkins-CLI-Host", TcpSlaveAgentListener.CLI_HOST_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
@Restricted(NoExternalUse.class) // for actions.jelly and ContextMenu.add
|
||||
public static boolean isContextMenuVisible(Action a) {
|
||||
if (a instanceof ModelObjectWithContextMenu.ContextMenuVisibility) {
|
||||
return ((ModelObjectWithContextMenu.ContextMenuVisibility) a).isVisible();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user