Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jacob_robertson
committed
Mar 26, 2012
1 parent
3d3a3b7
commit 2509535
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package hudson.views; | ||
|
||
import hudson.Extension; | ||
import hudson.model.JobProperty; | ||
import hudson.model.TopLevelItem; | ||
import hudson.model.Descriptor; | ||
import hudson.model.Job; | ||
import hudson.security.AuthorizationMatrixProperty; | ||
|
||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
/** | ||
* Simply filters on whether a job is secured through the "Project-based Matrix Authorization Strategy". | ||
* | ||
* @author jacob | ||
*/ | ||
public class SecuredJobsFilter extends AbstractIncludeExcludeJobFilter { | ||
|
||
@DataBoundConstructor | ||
public SecuredJobsFilter(String includeExcludeTypeString) { | ||
super(includeExcludeTypeString); | ||
} | ||
|
||
@SuppressWarnings({ "rawtypes", "unchecked" }) | ||
protected boolean matches(TopLevelItem item) { | ||
if (item instanceof Job) { | ||
Job job = (Job) item; | ||
JobProperty prop = job.getProperty(AuthorizationMatrixProperty.class); | ||
return (prop != null); | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
@Extension | ||
public static class DescriptorImpl extends Descriptor<ViewJobFilter> { | ||
@Override | ||
public String getDisplayName() { | ||
return "Project-based Secured Jobs"; | ||
} | ||
@Override | ||
public String getHelpFile() { | ||
return "/plugin/view-job-filters/secured-jobs-help.html"; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div> | ||
Filters on whether a job has selected the "Enable project-based security" option. | ||
<br/><br/> | ||
<b>NOTE:</b> This filter does not <u>provide</u> security - it merely provides convenient views that feed off of the security you've already set up. | ||
</div> |