Question: Milestone - Coding - Python - Authorization Decorator Given a database of ( key , value ) pairs, add security to the database as an

Milestone - Coding - Python -
Authorization Decorator
Given a database of (key, value) pairs, add
security to the database as an authorization
decorator. It takes a set of enum objects as
arguments.
The enum object and database controller
are defined as shown in the template.
Implement the decorator to handle valid
requests. For requests that fail, raise a
custom AccessDeniedError exception.
AccessLevels and User classes:
class AccessLevels(Enum):
USER =0# Can read
ADMIN =1 # Can read and
write
GUEST =2 # Can neither read
nor write
Qdataclass
class User (ob ject):
fd: sert
acCe3s: ACCESSLEVETS
 Milestone - Coding - Python - Authorization Decorator Given a database

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!