提交 b067ba87 编写于 作者: K Kohsuke Kawaguchi

Allow User to be injected via @AncestorInPath

上级 9ac09aee
...@@ -96,7 +96,7 @@ import java.util.logging.Logger; ...@@ -96,7 +96,7 @@ import java.util.logging.Logger;
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
@ExportedBean @ExportedBean
public class User extends AbstractModelObject implements AccessControlled, Saveable, Comparable<User> { public class User extends AbstractModelObject implements AccessControlled, DescriptorByNameOwner, Saveable, Comparable<User> {
private transient final String id; private transient final String id;
...@@ -574,6 +574,10 @@ public class User extends AbstractModelObject implements AccessControlled, Savea ...@@ -574,6 +574,10 @@ public class User extends AbstractModelObject implements AccessControlled, Savea
&& new File(getRootDir(), id).exists(); && new File(getRootDir(), id).exists();
} }
public Descriptor getDescriptorByName(String className) {
return Jenkins.getInstance().getDescriptorByName(className);
}
public Object getDynamic(String token) { public Object getDynamic(String token) {
for (UserProperty property: getProperties().values()) { for (UserProperty property: getProperties().values()) {
if (property instanceof Action) { if (property instanceof Action) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册