Calendar + NLP modules implemented
This commit is contained in:
@@ -11,7 +11,7 @@ class RoleChecker:
|
||||
|
||||
def __call__(self, user: User = Depends(get_current_user)):
|
||||
if user.role not in self.allowed_roles:
|
||||
forbidden_exception("You do not have permission to perform this action.")
|
||||
raise forbidden_exception("You do not have permission to perform this action.")
|
||||
return user
|
||||
|
||||
admin_only = RoleChecker([UserRole.ADMIN])
|
||||
|
||||
Reference in New Issue
Block a user