-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #7718] Permissions assignments on Remote Services #7719
Conversation
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.
- we should remove the visibily to Anonymous users when a new Service is created, otherwise any user can see other's services.
- "Add Remote Service" button is not available anymore. It ust be restored for any registered user (contributor).
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.
There are PEP-8 issues
^@^@geonode/services/views.py:104:1: W293 blank line contains whitespace
@mattiagiupponi unfortunately it looks there's still something to be fixed. |
@giohappy The issue was caused by the permissions used to understand if an user can add a resource or not. @afabiani pep8 issue fixed |
@mattiagiupponi as agreed we're going to revert the creation of the custom base_addresourcebase permission done in #7364. |
Migration fixed, I thought that the Django default permissions were applied before the other app migrations. Now should work |
@giohappy @mattiagiupponi I was testing the PR... I'm not sure if this could be a regression or it is something still not implemented, but:
I currently see it not being able to create new Remote Services only. Can you please provide more details on that? About the rest it looks good to me. |
Well as far as I see, looks like more something that is not implemented yet. geonode/geonode/templates/base.html Lines 300 to 307 in 1fdfb47
geonode/geonode/layers/templates/layers/layer_list_default.html Lines 11 to 13 in 1fdfb47
You do not see the remote service only because you are not logged in as a superuser or staff member: geonode/geonode/templates/base.html Lines 308 to 312 in 1fdfb47
@giohappy Maybe it is worth taking a look at all the templates and finding a common way to handle them. About And regarding that as a contributor you are not seeing the services, was requested that only the owner of the resource should be able to see them (as admin you can see all the resources). geonode/geonode/services/forms.py Lines 67 to 74 in 1fdfb47
|
But what's the meaning of creating a Remote Service that is visible only to the owner and than prevent him to add resources? |
@mattiagiupponi can you please check if this error https://app.circleci.com/pipelines/github/GeoNode/geonode/3426/workflows/01b1c1e1-7c1f-4076-9940-f0ea7f827a8d/jobs/10259 is related to the PR? |
i don't know, but I'm gonna check it |
I made some researches and looks like that was a bug in Django: Looks like that the solution is:
Or drop the actual DB and create a new one. |
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.
Oh wow! |
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.
…on visible resources
Fixed :) |
* [Backport Resolves #7392] Fix upload/replace/append layer * [Fixes #7718] Permissions assignments on Remote Services * [Fixes #7718] Permissions assignments on Remote Services * [Fixes #7718] Permissions assignments on Remote Services * [Fixes #7718] Permissions assignments on Remote Services * [Fixes #7718] Pep8 issues fixed * [Fixes #7718] Permissions assignments on Remote Services * [Fixes #7718] remove unused imports * [Fixes #7718] Fix broken migrations * [CircelCI] Tests fix * [Fixes #7718] db startup error * [Fixes #7718] Fix impovements from ISSUE * Update views.py * Update service_detail.html * [Fixes #7718] Fix count layers on services list, now is based on visible resources Co-authored-by: afabiani <[email protected]> (cherry picked from commit 0c71f23)
Basic implementation of permissions on remote services
Checklist
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.