Skip to content
Permalink
Browse files
[JENKINS-28881] - Prevent FolderOwnershipProperty changes on the conf…
…iguration submission
  • Loading branch information
oleg-nenashev committed Jan 2, 2016
1 parent 1458f93 commit 0be133350496b89778cb0434e05ababccfb4cea3
Showing 1 changed file with 9 additions and 0 deletions.
@@ -32,8 +32,11 @@
import com.synopsys.arc.jenkins.plugins.ownership.IOwnershipItem;
import com.synopsys.arc.jenkins.plugins.ownership.OwnershipDescription;
import hudson.Extension;
import hudson.model.Descriptor;
import java.io.IOException;
import javax.annotation.CheckForNull;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;

/**
* Ownership property for {@link Folder}s.
@@ -75,6 +78,12 @@ public void setOwnershipDescription(@CheckForNull OwnershipDescription descripti
ownership = description;
owner.save();
}

@Override
public AbstractFolderProperty<?> reconfigure(StaplerRequest req, JSONObject form) throws Descriptor.FormException {
// Retain the current configuration in order to prevent changes by form submissions
return new FolderOwnershipProperty(ownership);
}

@Extension(optional = true)
public static class DescriptorImpl extends AbstractFolderPropertyDescriptor {

0 comments on commit 0be1333

Please sign in to comment.