Skip to content

Commit 59045f0

Browse files
authored
Merge pull request #68 from jenkinsci/check-permission-for-check-methods
Also check for permissions in `doCheck` methods
2 parents 2dfd67c + abae4f3 commit 59045f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/java/io/jenkins/plugins/util/PluginArchitectureRules.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ public final class PluginArchitectureRules {
9595
*/
9696
public static final ArchRule USE_POST_FOR_VALIDATION_END_POINTS =
9797
methods().that().areDeclaredInClassesThat().areAssignableTo(Descriptor.class)
98-
.and().haveNameMatching("do[A-Z].*")
98+
.and().haveNameMatching("doCheck[A-Z].*")
9999
.and().haveRawReturnType(FormValidation.class)
100100
.and().haveRawParameterTypes(ofAllowedValidationMethodSignatures())
101101
.should().beAnnotatedWith(POST.class)
102-
.andShould().bePublic();
102+
.andShould().bePublic()
103+
.andShould(checkPermissions());
103104

104105
/**
105106
* List model methods that are used as AJAX end points must use @POST and have a permission check.

0 commit comments

Comments
 (0)