-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: prevent user to triger a downlaod csv task if task details api inaccessible #156
fix: prevent user to triger a downlaod csv task if task details api inaccessible #156
Conversation
49acfed
to
fa11b33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tehreem-sadat , I'm asking to move the check to become the first one in list
method. Please update it and it's good to go
if not self.request.fx_permission_info['download_allowed']: # type: ignore[attr-defined] | ||
return Response( | ||
{'detail': 'You are not permitted to use the "download" parameter'}, | ||
status=http_status.HTTP_403_FORBIDDEN | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move this check to become the first one
request.fx_permission_info = { | ||
'user': request.user, | ||
'user_roles': user_roles, | ||
'is_system_staff_user': system_staff_user_flag, | ||
'view_allowed_roles': view_allowed_roles, | ||
'view_allowed_tenant_ids_any_access': tenant_ids, | ||
'download_allowed': download_allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'download_allowed': download_allowed | |
'download_allowed': download_allowed, |
} | ||
|
||
if system_staff_user_flag: | ||
request.fx_permission_info.update({ | ||
'user_roles': {}, | ||
'download_allowed': True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'download_allowed': True | |
'download_allowed': True, |
fa11b33
to
d037808
Compare
d037808
to
554cc3c
Compare
Issue: #152