fix events search

This commit is contained in:
junotx
2020-05-27 13:22:17 +08:00
parent e119fd8a36
commit 5818733481
2 changed files with 24 additions and 26 deletions

View File

@@ -303,20 +303,7 @@ func (t *tenantOperator) listIntersectedNamespaces(user user.Info,
iNamespaces []*corev1.Namespace
)
// When user can list all namespaces, the namespaces which do not belong to any workspace should be considered
listNs := authorizer.AttributesRecord{
User: user,
Verb: "list",
APIGroup: "",
APIVersion: "v1",
Resource: "namespaces",
ResourceRequest: true,
}
decision, _, err := t.authorizer.Authorize(listNs)
if err != nil {
return nil, err
}
includeNsWithoutWs := len(workspaceSet) == 0 && len(workspaceSubstrs) == 0 && decision == authorizer.DecisionAllow
includeNsWithoutWs := len(workspaceSet) == 0 && len(workspaceSubstrs) == 0
roleBindings, err := t.am.ListRoleBindings(user.GetName(), "")
if err != nil {