perf: 优化会话 api

This commit is contained in:
ibuler
2023-10-07 14:47:17 +08:00
committed by 老广
parent 42b4e7697d
commit f206d963a0
4 changed files with 14 additions and 10 deletions

View File

@@ -92,7 +92,12 @@ class SessionViewSet(RecordViewLogMixin, OrgBulkModelViewSet):
rbac_perms = {
'download': ['terminal.download_sessionreplay'],
}
permission_classes = [RBACPermission | IsSessionAssignee]
permission_classes = [RBACPermission]
def get_permissions(self):
if self.action == 'retrieve':
self.permission_classes = [RBACPermission | IsSessionAssignee]
return super().get_permissions()
@staticmethod
def prepare_offline_file(session, local_path):