mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-07 09:06:03 +00:00
This defaulting is convenient in making the use of this method terse.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6471 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
445d05ea4c
commit
983f99e20d
1 file changed
+4
-1
@@ -420,9 +420,12 @@ public class Functions {
|
||||
|
||||
/**
|
||||
* Returns true if the current user has the given permission.
|
||||
*
|
||||
* @param permission
|
||||
* If null, returns true. This defaulting is convenient in making the use of this method terse.
|
||||
*/
|
||||
public static boolean hasPermission(Permission permission) throws IOException, ServletException {
|
||||
return Hudson.getInstance().getACL().hasPermission(permission);
|
||||
return permission==null || Hudson.getInstance().getACL().hasPermission(permission);
|
||||
}
|
||||
|
||||
public static void adminCheck(StaplerRequest req, StaplerResponse rsp, Object required, Permission permission) throws IOException, ServletException {
|
||||
|
||||
Reference in new issue
Block a user