Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

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

Highlighted

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

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

@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