Skip to content

Commit

Permalink
Merge pull request #682 from dblevin1/fix-file-access-list
Browse files Browse the repository at this point in the history
fix DAFile user_access and privilege_access list
  • Loading branch information
jhpyle authored Sep 9, 2023
2 parents 81b9ef2 + 5a64818 commit bb8dc94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docassemble_webapp/docassemble/webapp/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ def file_user_access(file_number, allow_user_id=None, allow_email=None, disallow
db.session.execute(delete(UploadsUserAuth).filter_by(uploads_indexno=file_number))
if not (allow_user_id or allow_email or disallow_user_id or disallow_email or disallow_all):
result = {'user_ids': [], 'emails': [], 'temp_user_ids': []}
for auth in db.session.execute(select(UploadsUserAuth.user_id, UploadsUserAuth.temp_user_id, UserModel.email).outerjoin(UserModel, UploadsUserAuth.user_id == UserModel.id).where(UploadsUserAuth.uploads_indexno == file_number)).scalars().all():
for auth in db.session.execute(select(UploadsUserAuth.user_id, UploadsUserAuth.temp_user_id, UserModel.email).outerjoin(UserModel, UploadsUserAuth.user_id == UserModel.id).where(UploadsUserAuth.uploads_indexno == file_number)).all():
if auth.user_id is not None:
result['user_ids'].append(auth.user_id)
if auth.temp_user_id is not None:
Expand Down Expand Up @@ -1228,7 +1228,7 @@ def file_privilege_access(file_number, allow=None, disallow=None, disallow_all=F
db.session.execute(delete(UploadsRoleAuth).filter_by(uploads_indexno=file_number))
if not (allow or disallow or disallow_all):
result = []
for auth in db.session.execute(select(UploadsRoleAuth.id, Role.name).join(Role, UploadsRoleAuth.role_id == Role.id).where(UploadsRoleAuth.uploads_indexno == file_number)).scalars():
for auth in db.session.execute(select(UploadsRoleAuth.id, Role.name).join(Role, UploadsRoleAuth.role_id == Role.id).where(UploadsRoleAuth.uploads_indexno == file_number)).all():
result.append(auth.name)
return result
return None
Expand Down

0 comments on commit bb8dc94

Please sign in to comment.