dashboard/areas/roles/role_service.py
2022-05-26 09:49:25 +00:00

12 lines
287 B
Python

from .models import Role
class RoleService:
@staticmethod
def get_roles():
roles = Role.query.all()
return [{"id": r.id, "name": r.name} for r in roles]
@staticmethod
def get_role_by_id(role_id):
return Role.query.filter_by(id=role_id).first()