Commit 88985abe by Samuel Padgett

Always return false in canI checks where resource is not set

parent 029f74c0
......@@ -1100,6 +1100,12 @@ angular.module("openshiftCommonServices")
return true;
}
// Explicitly check for falsey resources so we don't return true when the
// group has a wildcard. If resource is falsey, return false always.
if (!resource) {
return false;
}
// normalize to structured form
var r = APIService.toResourceGroupVersion(resource);
var rules = getRulesForProject(projectName || currentProject);
......
......@@ -3166,6 +3166,12 @@ angular.module("openshiftCommonServices")
return true;
}
// Explicitly check for falsey resources so we don't return true when the
// group has a wildcard. If resource is falsey, return false always.
if (!resource) {
return false;
}
// normalize to structured form
var r = APIService.toResourceGroupVersion(resource);
var rules = getRulesForProject(projectName || currentProject);
......
......@@ -1416,6 +1416,7 @@ return l.promise;
},
canI: function(e, t, n) {
if (c) return !0;
if (!e) return !1;
var r = o.toResourceGroupVersion(e), i = g(n || a);
return !!i && (h(i, t, r.group, r.resource) || h(i, t, "*", "*") || h(i, t, r.group, "*") || h(i, t, "*", r.resource));
},
......
......@@ -141,6 +141,12 @@ angular.module("openshiftCommonServices")
return true;
}
// Explicitly check for falsey resources so we don't return true when the
// group has a wildcard. If resource is falsey, return false always.
if (!resource) {
return false;
}
// normalize to structured form
var r = APIService.toResourceGroupVersion(resource);
var rules = getRulesForProject(projectName || currentProject);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment