1.优化获取已建报表时只有报表的创建者可以看到,修改成配置了相关权限的用户可以看到
This commit is contained in:
parent
5450ed6b4a
commit
1b0957a512
@ -43,7 +43,7 @@ async def edit(
|
|||||||
#只能报表所有者编辑
|
#只能报表所有者编辑
|
||||||
# res = await crud.report.update_one(db, {'_id': data_in.report_id, 'user_id': request.user.id},
|
# res = await crud.report.update_one(db, {'_id': data_in.report_id, 'user_id': request.user.id},
|
||||||
# {'$set': {'query': data_in.query, 'name': data_in.name, 'desc': data_in.desc}})
|
# {'$set': {'query': data_in.query, 'name': data_in.name, 'desc': data_in.desc}})
|
||||||
|
|
||||||
# if not res.matched_count:
|
# if not res.matched_count:
|
||||||
# #if res.matched_count:
|
# #if res.matched_count:
|
||||||
# return schemas.Msg(code=-1, msg='只能报表所有者编辑')
|
# return schemas.Msg(code=-1, msg='只能报表所有者编辑')
|
||||||
@ -90,8 +90,12 @@ async def read_report(
|
|||||||
dashboard = await crud.dashboard.get(db, id=data_in.dashboard_id)
|
dashboard = await crud.dashboard.get(db, id=data_in.dashboard_id)
|
||||||
# projection = {'query': False}
|
# projection = {'query': False}
|
||||||
projection = None
|
projection = None
|
||||||
|
#获取已建报表 属于自己的
|
||||||
|
# reports = await crud.report.read_report(db, project_id=data_in.project_id,
|
||||||
|
# projection=projection, **ext_where)
|
||||||
|
#有权限的都能获取到
|
||||||
reports = await crud.report.read_report(db, project_id=data_in.project_id,
|
reports = await crud.report.read_report(db, project_id=data_in.project_id,
|
||||||
projection=projection, **ext_where)
|
projection=projection)
|
||||||
|
|
||||||
for item in reports:
|
for item in reports:
|
||||||
item['added'] = False
|
item['added'] = False
|
||||||
|
Loading…
Reference in New Issue
Block a user