Skip to content
Snippets Groups Projects
Commit 1af59394 authored by Arie Peterson's avatar Arie Peterson
Browse files

Make sure we get the right ID for the dashboard app

parent 22675551
No related branches found
No related tags found
1 merge request!84Resolve "Support adding a TOTP device"
from areas.apps.models import AppRole
from areas.apps.models import App, AppRole
from .models import Role
......@@ -14,5 +14,6 @@ class RoleService:
@staticmethod
def is_user_admin(userId):
dashboard_role_id = AppRole.query.filter_by(user_id=userId, app_id=1).first().role_id
dashboard_app_id = App.query.filter_by(slug='dashboard').first().id
dashboard_role_id = AppRole.query.filter_by(user_id=userId, app_id=dashboard_app_id).first().role_id
return dashboard_role_id == 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment