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 AccessLevelsEnum:
USER # Can read
ADMIN # Can read and
write
GUEST # Can neither read
nor write
Qdataclass
class User ob ject:
fd: sert
acCes: ACCESSLEVETS
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
