Adding a role through Hive
How to add a role in Hive.
To grant the Admin_Role privilege, in Ranger:
- Select Settings > Users/Groups/Roles, then click the Users tab.
Click the user name to which you want the Admin_Role privilege granted.
The User Edit page appears.
- From the Select Role list, select Admin, then click Save.
- Log in as a user with Admin_Role privilege.
Type the following command:
CREATE ROLE external_hr_role_01;
Any user with Is_Role_Admin privilege has the ability to assign the role to other users in Hive.For example, to grant this new role to the user hr_user01, type:
GRANT ROLE external_hr_role_01 TO USER hr_user01;
hr_user01 appears in Ranger having the external_hr_role_01 role.You can also grant Is_Role_Admin privilege to a specific user by typing:
GRANT ROLE external_hr_role_01 TO USER hr_user02 WITH ADMIN OPTION;The role you create appears in Ranger and is recognized by Hive. The user that creates the role adds automatically to the list of users having that role. The added user has the Is_Role_Admin privilege, as shown in Ranger: