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
This commit is contained in:
dty committed 2008-11-13 22:43:24 +00:00
1 parent 163fc043f2
commit 885f61061f
2 files changed
+12 -1

No files matched your search

@@ -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