List permission of specific user in openshift

4.7k views Asked by At

I would like to know how to list all the permission belongs to a specific user/ group.

I am using oc describe clusterrolebinding | grep <user> and but I don't think that is correct.

2

There are 2 answers

2
Simon On

The OpenShift CLI has some commands that you can use to get your own permissions in OpenShift:

oc auth can-i --list

If you want to check if a certain user can perform a certain operation, you can use the following command:

oc policy who-can
# Example: oc policy who-can list pods
1
Sam On

Yes you can check permissions for users or groups.

For listing users

oc get users

For listing groups

oc get groups

For specific action/resource for a specific user

oc auth can-i create configmap --as=<user>

To list all permission for a specific user

oc auth can-i --as=<user> --list

Same for a groups Ex.:

oc get groups
oc auth can-i --as-group=<group> --list