Merge branch 'main' into feat/api-role-permission-layer

This commit is contained in:
Maarten de Waard 2022-06-15 14:19:44 +02:00
commit 3eea6ab2bf
No known key found for this signature in database
GPG key ID: 1D3E893A657CC8DA
3 changed files with 104 additions and 7 deletions

View file

@ -0,0 +1,12 @@
from .models import App, AppRole
class AppsService:
@staticmethod
def get_apps():
apps = App.query.all()
return [{"id": app.id, "name": app.name, "slug": app.slug} for app in apps]
@staticmethod
def get_app_roles():
app_roles = AppRole.query.all()
return [{"user_id": app_role.user_id, "app_id": app_role.app_id, "role_id": app_role.role_id} for app_role in app_roles]