Community Articles
Find and share helpful community-sourced technical articles
Labels (1)

This article just gives an example of how grant/revoke works when hive plugin is enabled with Ranger.

Doc reference -

A user who is admin in Ranger, can manage access to hive tables via grant/revoke operation.

In Ranger UI -> Settings -> Users and Groups -> Users

User “hive” is in Role “Admin” -


On the beeline, login as user hive:

[hive@c141-node5 root]$ beeline -u "jdbc:hive2://,,;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" -n hive

Run the grant command to give select privileges on a table:


In Ranger a new policy is created by that command:


Similarly a revoke run, user mugdha will be removed from the policy:

0: jdbc:hive2://,c14> revoke select on pageviews from user mugdha;
No rows affected (0.169 seconds)
0: jdbc:hive2://,c14>