提交 885f6106 编写于 作者: D dty

FIX HUDSON-2305 - Use Project Security setting not being persisted.



git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13223 71c3de6d-444a-0410-be80-ed276b4c234a
上级 163fc043
......@@ -217,6 +217,10 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
MarshallingContext context) {
AuthorizationMatrixProperty amp = (AuthorizationMatrixProperty) source;
writer.startNode("useProjectSecurity");
context.convertAnother(Boolean.valueOf(amp.isUseProjectSecurity()));
writer.endNode();
for (Entry<Permission, Set<String>> e : amp.grantedPermissions
.entrySet()) {
String p = e.getKey().getId();
......@@ -233,6 +237,13 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
final UnmarshallingContext context) {
AuthorizationMatrixProperty as = new AuthorizationMatrixProperty();
String prop = reader.peekNextChild();
if (prop!=null && prop.equals("useProjectSecurity")) {
reader.moveDown();
Boolean useSecurity = (Boolean) context.convertAnother(as, Boolean.class);
as.setUseProjectSecurity(useSecurity.booleanValue());
reader.moveUp();
}
while (reader.hasMoreChildren()) {
reader.moveDown();
String id = (String) context.convertAnother(as, String.class);
......
......@@ -57,7 +57,7 @@ public class ProjectMatrixAuthorizationStrategy extends GlobalMatrixAuthorizatio
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
String name = reader.peekNextChild();
if(name!=null && name.equals("permission"))
if(name!=null && (name.equals("permission") || name.equals("useProjectSecurity")))
// the proper serialization form
return super.unmarshal(reader, context);
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册