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

[Fixes #12616] Document upload permissions fix #12707

Conversation

kilichenko-pixida
Copy link
Contributor

Aims to resolve #12616

It seems like the problem was that permissions were assigned to None both when handling UI and API document upload. On UI it didn't cause a problem because in UI upload there is also a call setting permissions to defaults again. Here I am removing the unnecceary assigment of permissions to None in UI code and setting permissiosn to defaults in API code.

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.
  • Commit message must be in the form "[Fixes #<issue_number>] Title of the Issue"
  • PR title must be in the form "[Fixes #<issue_number>] Title of the PR"

Copy link

cla-bot bot commented Nov 8, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @kilichenko-pixida on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.01%. Comparing base (5d5a99a) to head (b67e59f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12707      +/-   ##
==========================================
- Coverage   67.02%   67.01%   -0.01%     
==========================================
  Files         952      952              
  Lines       56905    56905              
  Branches     6723     6723              
==========================================
- Hits        38139    38135       -4     
- Misses      17155    17159       +4     
  Partials     1611     1611              

@giohappy
Copy link
Contributor

@kilichenko-pixida we're going to review this PR. Meanwhile please include your github account at the end of the .clabot file to sign the Contributor License Agreement.

@@ -137,7 +137,7 @@ def perform_create(self, serializer):

resource.set_missing_info()
resourcebase_post_save(resource.get_real_instance())
resource_manager.set_permissions(None, instance=resource, permissions=None, created=True)
resource.set_default_permissions(owner=self.request.user)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case we should keep created=True since we are in the creating workflow

geonode/documents/views.py Show resolved Hide resolved
Copy link

cla-bot bot commented Nov 12, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @kilichenko-pixida on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

Copy link

cla-bot bot commented Nov 12, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @kilichenko-pixida on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

Copy link

cla-bot bot commented Nov 12, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @kilichenko-pixida on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

@mattiagiupponi mattiagiupponi merged commit 17c4707 into GeoNode:master Nov 12, 2024
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

via REST API uploaded documents to not get proper permissions
3 participants