> For the complete documentation index, see [llms.txt](https://docs.cloudeka.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudeka.ai/reference/kubernetes-user-creation-with-rbac/list-existing-access.md).

# List Existing Access

List `RoleBinding` objects for the user across all namespaces :

```
kubectl get rolebindings >-all-namespaces \
  -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}
{.metadata.name}{"\t"}{.roleRef.name}{"\t"}{range .subjects[*]}{.kind}:
{.name}{","}{end}{"\n"}{end}' \
  | awk -F '\t' '$4 ~ /(^|,)User><USERNAME>(,|$)/ {print $1 "\t" $2 "\t" 
$3}' \
  | column -t
```

List `ClusterRoleBinding` objects for the user :

```
kubectl get clusterrolebindings \
  -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.roleRef.name}
{"\t"}{range .subjects[*]}{.kind}:{.name}{","}{end}{"\n"}{end}' \
  | awk -F '\t' '$3 ~ /(^|,)User><USERNAME>(,|$)/ {print $1 "\t" $2}' \
  | column -t
```

{% hint style="info" %}
TIP\
These filters inspect every subject on each binding. They do not assume the user appears\
in `subjects[0]`
{% endhint %}
