提交 7155fb5b 编写于 作者: K kohsuke

adding more convenience methods.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6467 71c3de6d-444a-0410-be80-ed276b4c234a
上级 5a83f88f
......@@ -414,6 +414,17 @@ public class Functions {
return Util.xmlEscape(s);
}
public static void checkPermission(Permission permission) throws IOException, ServletException {
Hudson.getInstance().getACL().checkPermission(permission);
}
/**
* Returns true if the current user has the given permission.
*/
public static boolean hasPermission(Permission permission) throws IOException, ServletException {
return Hudson.getInstance().getACL().hasPermission(permission);
}
public static void adminCheck(StaplerRequest req, StaplerResponse rsp, Object required, Permission permission) throws IOException, ServletException {
// this is legacy --- all views should be eventually converted to
// the permission based model.
......@@ -426,7 +437,7 @@ public class Functions {
// make sure the user owns the necessary permission to access this page.
if(permission!=null)
Hudson.getInstance().getACL().checkPermission(permission);
checkPermission(permission);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册