| | |
| | | import uuid |
| | | |
| | | from Log import logger |
| | | from app.config.const import DEPT_STATUS_ON |
| | | from app.models import OrganizationModel |
| | | from app.models.resource_model import ResourceModel |
| | | from app.models.role_model import RoleModel |
| | |
| | | total = query.count() |
| | | roles = query.order_by(RoleModel.created_at.desc()).limit(page_size).offset( |
| | | (page_index - 1) * page_size).all() |
| | | return {"total": total, "rows": [role.to_json() for role in roles]} |
| | | return {"total": total, "rows": [role.to_json() for role in roles if role.status == DEPT_STATUS_ON]} |
| | | |
| | | |
| | | async def create_role(db, role_name: str, description: str, role_key, data_scope, user_id): |