Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 862 #1375

Merged
merged 4 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,4 @@ results.sqlite
tasks/*
~/*
tasks
docker-entrypoint.sh
30 changes: 30 additions & 0 deletions api/v1/views/mine.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,36 @@ def get_mine_apps_with_group(request, tenant_id: str, app_group_id:str=None, ord

return list(apps) if apps else []

@api.get("/mine/tenant/{tenant_id}/mine_group_apps_all/", response=MineAppListOut, tags=["我的"])
@operation(MineAppListOut,roles=[NORMAL_USER, TENANT_ADMIN, PLATFORM_ADMIN])
def get_mine_apps_with_group_all(request, tenant_id: str, app_group_id:str=None, order:str=None):
"""获取我的分组应用
"""
apps = []
if app_group_id in [None,"","0",0]:
apps = App.active_objects.filter(
Q(tenant=request.tenant) | Q(entry_permission__is_open=True)
)
else:
app_group = AppGroup.active_objects.get(
tenant =request.tenant,
id=app_group_id
)
apps = app_group.apps.filter(Q(tenant=request.tenant) | Q(entry_permission__is_open=True))
# 需要甄别有入口权限的应用
from arkid.core.perm.permission_data import PermissionData
pd = PermissionData()
app_ids = pd.get_entry_apps(request.user, tenant_id, apps)
if app_ids:
apps = apps.filter(id__in=app_ids)
else:
apps = apps.filter(id=None)
if order:
apps = apps.order_by(order)
apps = apps.all()

return SuccessDict(data=list(apps) if apps else [])

@api.get("/mine/unread_messages/",response=List[MineMessageListItemOut],tags=["我的"],auth=GlobalAuth())
@operation(MineMessageListOut,roles=[NORMAL_USER, TENANT_ADMIN, PLATFORM_ADMIN])
@paginate(CustomPagination)
Expand Down
Empty file modified docker-entrypoint.sh
100644 → 100755
Empty file.