def get_permissions(*, limit: int, offset: Optional[int] = None) -> APIResponse: """Get permissions""" session = current_app.appbuilder.get_session total_entries = session.query(func.count(Action.id)).scalar() query = session.query(Action) actions = query.offset(offset).limit(limit).all() return action_collection_schema.dump(ActionCollection(actions=actions, total_entries=total_entries))
def get_permissions(limit=None, offset=None): """Get permissions""" session = current_app.appbuilder.get_session total_entries = session.query(func.count(Permission.id)).scalar() query = session.query(Permission) actions = query.offset(offset).limit(limit).all() return action_collection_schema.dump(ActionCollection(actions=actions, total_entries=total_entries))