MR comments
- added error handler for unauthorized
This commit is contained in:
parent
907e0ecaab
commit
19bc31e6e3
4 changed files with 12 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ class RoleService:
|
|||
def get_role_by_id(role_id):
|
||||
return Role.query.filter_by(id=role_id).first()
|
||||
|
||||
@staticmethod
|
||||
def is_user_admin(userId):
|
||||
dashboard_role_id = AppRole.query.filter_by(user_id=userId, app_id=1).first().role_id
|
||||
return dashboard_role_id == 1
|
||||
Reference in a new issue