提交 ef34eb5a 编写于 作者: I Ing. Pavel Janousek

View getView(String name): checkPermission() -> hasPermission() and return...

View getView(String name): checkPermission() -> hasPermission() and return NULL if the user doesn't have a READ permission
上级 9d284a5e
......@@ -78,9 +78,11 @@ public class ViewOptionHandler extends OptionHandler<View> {
/**
*
* Gets a view by its name
* Note: Personal user's views aren't supported now.
*
* @param name A view name
* @return The {@link View} instance. Null if {@link Jenkins#getInstance()} returns null.
* @return The {@link View} instance. Null if {@link Jenkins#getInstance()} returns null
* sor user doesn't have a READ permission.
* @throws CmdLineException
* If view isn't found or an un-expected error occurred
* @since TODO
......@@ -106,7 +108,8 @@ public class ViewOptionHandler extends OptionHandler<View> {
viewName, group.getDisplayName()
));
view.checkPermission(View.READ);
if(!view.hasPermission(View.READ))
return null;
if (view instanceof ViewGroup) {
group = (ViewGroup) view;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册