提交 983f99e2 编写于 作者: K kohsuke

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
上级 445d05ea
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册