Skip to content

Commit

Permalink
[JENKINS-28881] - Prevent FolderOwnershipProperty changes on the conf…
Browse files Browse the repository at this point in the history
…iguration submission
  • Loading branch information
oleg-nenashev committed Jan 2, 2016
1 parent 1458f93 commit 0be1333
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0be1333

Please sign in to comment.