File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/io/jenkins/plugins/util Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 88
99import org .apache .commons .lang3 .StringUtils ;
1010
11+ import edu .umd .cs .findbugs .annotations .CheckForNull ;
12+
1113import org .kohsuke .stapler .Stapler ;
1214import org .kohsuke .stapler .StaplerRequest ;
1315import hudson .DescriptorExtensionList ;
@@ -86,7 +88,10 @@ public boolean hasPermission(final Permission permission) {
8688 *
8789 * @return {@code false} if the user doesn't have the permission
8890 */
89- public boolean hasPermission (final Permission permission , final Job <?, ?> project ) {
91+ public boolean hasPermission (final Permission permission , @ CheckForNull final Job <?, ?> project ) {
92+ if (project == null ) {
93+ return hasPermission (permission );
94+ }
9095 return getJenkins ().getAuthorizationStrategy ().getACL (project ).hasPermission (permission );
9196 }
9297
You can’t perform that action at this time.
0 commit comments