提交 2513f92f 编写于 作者: K Kohsuke Kawaguchi

inherit from parent, not just the root

上级 b9606de9
......@@ -23,8 +23,11 @@
*/
package hudson.security;
import hudson.model.AbstractItem;
import hudson.model.Descriptor;
import hudson.model.Hudson;
import hudson.model.Item;
import hudson.model.ItemGroup;
import hudson.model.Job;
import hudson.util.RobustReflectionConverter;
import hudson.Extension;
......@@ -49,12 +52,25 @@ public class ProjectMatrixAuthorizationStrategy extends GlobalMatrixAuthorizatio
public ACL getACL(Job<?,?> project) {
AuthorizationMatrixProperty amp = project.getProperty(AuthorizationMatrixProperty.class);
if (amp != null) {
return amp.getACL().newInheritingACL(getRootACL());
return amp.getACL().newInheritingACL(getACL(project.getParent()));
} else {
return getRootACL();
}
}
public SidACL getACL(ItemGroup g) {
if (g instanceof Item) {
Item item = (Item) g;
return (SidACL)item.getACL();
}
return getRootACL();
}
@Override
public SidACL getACL(AbstractItem item) {
return getACL(item.getParent());
}
@Override
public Set<String> getGroups() {
Set<String> r = new HashSet<String>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册