0
0
Hadoopdata~30 mins

Apache Ranger for authorization in Hadoop - Mini Project: Build & Apply

Choose your learning style9 modes available
Apache Ranger for Authorization
📖 Scenario: You are working in a company that uses Hadoop to store and process big data. To keep data safe, the company uses Apache Ranger to control who can access which data.Apache Ranger helps set rules so only the right people can see or change data.
🎯 Goal: You will create a simple setup to define user permissions using Apache Ranger concepts. You will create a list of users and their roles, set a permission level, check who can access data, and finally print the users who have access.
📋 What You'll Learn
Create a dictionary of users with their roles
Create a variable for minimum permission level required
Use a loop to find users with permission level equal or higher than the minimum
Print the list of users who have access
💡 Why This Matters
🌍 Real World
Apache Ranger is used in big data environments to control who can see or change data. This project shows a simple way to check user permissions.
💼 Career
Understanding authorization helps data engineers and security analysts protect sensitive data and comply with company policies.
Progress0 / 4 steps
1
Create a dictionary of users and their roles
Create a dictionary called user_roles with these exact entries: 'alice': 'admin', 'bob': 'user', 'carol': 'guest', 'dave': 'user', 'eve': 'admin'
Hadoop
Need a hint?

Use curly braces {} to create a dictionary. Each entry has a username as key and role as value.

2
Set the minimum permission level required
Create a variable called min_permission and set it to the string 'user' to represent the minimum role needed to access data.
Hadoop
Need a hint?

Just assign the string 'user' to the variable min_permission.

3
Find users with permission level equal or higher than minimum
Create a list called allowed_users that contains usernames from user_roles whose role is either 'admin' or 'user'. Use a for loop with variables user and role to iterate over user_roles.items().
Hadoop
Need a hint?

Use a for loop to check each user's role. If role is 'admin' or 'user', add the username to allowed_users list.

4
Print the list of users who have access
Write a print statement to display the allowed_users list.
Hadoop
Need a hint?

Use print(allowed_users) to show the list of users who have access.