Support Questions

Find answers, ask questions, and share your expertise

How to check which user is mapped to which ranger policy ?

I want to get details of all users mapped to a particular policy or policies in the ranger , I ma checking mysql ranger database, but no significant details I found yet . can somebody please help me out ?

1 REPLY 1

@Anurag Mishra,

You can query the policy by ID and check the users associated with the policy

curl -ivk -H "X-Requested-By: ambari" -H "Accept: application/json" -u {ranger-username}:{ranger-password} http://{ranger-host}:{ranger-port}/service/plugins/policies/{policy-id}

replace the place holders in the above url

To get the users of the policy, iterate through the policyItems array and check for users in each object of the array.

Thanks,

Aditya