geonode
geonode copied to clipboard
forever loading state on index site (API returns 403)
Expected Behavior
The home catalogue screen gets displayed.
Actual Behavior
The new index site does not render and mapstore is in a forever loading state due to two errors:
GET http://localhost/api/o/v4/userinfo GET http://localhost/api/v2/resources/resource_types
both returns return a 403 permission denied
Steps to Reproduce the Problem
- clone geonode 4.x (7244bdc5f0404c0f7cf903bef8bae74c535c5e7d)
- docker-compose build
- docker-compose up
- open GeoNode site (eg. localhost)
Specifications
- GeoNode version: geonode 4.x (7244bdc5f0404c0f7cf903bef8bae74c535c5e7d)
- Installation method (manual, GeoNode Docker, SPCGeoNode Docker): GeoNode Docker
- Platform: Ubuntu
- Additional details: fresh build
Maybe a regression based on #9804 (not tested yet)
reverting to 3be00eec210c31ff3934eebba70e81e92a429e34 seems to fix the issue
Hi @gannebamm It may be a regression introduced by this https://github.com/GeoNode/geonode/issues/9804 The idea behind the permission class is:
- Does the request is on a specific resource? -> Yes, so I'll check the permission on that resource that belongs to the user and its group to see if the user can do something
- Is It a general endpoint? -> yes, I'll check if the user and its groups have those permissions on any of the resources available
This is missing:
- It's a general endpoint and there is no resource available?
We can fix it by saying:
- It's a general endpoint and there is no resource available? -> yes, the anonymous and the user can perform a GET request
@gannebamm can you please try the fix in this branch?
@mattiagiupponi yes, I will test it this afternoon and reply back. Thanks!
I could replicate the error with/without the changes you have done in permissions.py Applying the WIP PR fixed the issue, and I was able to start with a fresh installation properly.
I could replicate the error with/without the changes you have done in permissions.py Applying the WIP PR fixed the issue, and I was able to start with a fresh installation properly.
Great, I mark it as ready for review, I also put you as a reviewer :)