提交 3cd35cf8 编写于 作者: K kohsuke

bringing the pseudo immutability back.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23308 71c3de6d-444a-0410-be80-ed276b4c234a
上级 fdba356f
......@@ -59,6 +59,9 @@ import javax.servlet.ServletException;
/**
* {@link JobProperty} to associate ACL for each project.
*
* <p>
* Once created (and initialized), this object becomes immutable.
*/
public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
......@@ -70,10 +73,6 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
return useProjectSecurity;
}
protected void setUseProjectSecurity(boolean useProjectSecurity) {
this.useProjectSecurity = useProjectSecurity;
}
/**
* List up all permissions that are granted.
*
......@@ -126,7 +125,7 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
formData = formData.getJSONObject("useProjectSecurity");
if(!formData.isNullObject()) {
amp.setUseProjectSecurity(true);
amp.useProjectSecurity = true;
for (Map.Entry<String, Object> r : (Set<Map.Entry<String, Object>>) formData.getJSONObject("data").entrySet()) {
String sid = r.getKey();
if (r.getValue() instanceof JSONObject) {
......@@ -251,8 +250,7 @@ public class AuthorizationMatrixProperty extends JobProperty<Job<?, ?>> {
String prop = reader.peekNextChild();
if (prop!=null && prop.equals("useProjectSecurity")) {
reader.moveDown();
Boolean useSecurity = (Boolean) context.convertAnother(as, Boolean.class);
as.setUseProjectSecurity(useSecurity);
as.useProjectSecurity = (Boolean) context.convertAnother(as, Boolean.class);
reader.moveUp();
}
while (reader.hasMoreChildren()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册