Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions geonode/security/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,6 @@ def _get_global_perms(self, user):
if codename in PERMISSIONS:
# return constant names defined by GeoNode
perms.add(PERMISSIONS[codename])
Comment on lines 433 to 435
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The removal of the else block restricts global permissions to only those explicitly defined in the PERMISSIONS map (which currently only contains add_resourcebase). This will cause other GeoNode-specific global permissions that do not require mapping, such as add_service, delete_service, or any custom permissions from extensions, to be excluded from the global permissions payload.

While this successfully reduces the payload size by filtering out Django/Guardian internal permissions, it may lead to regressions in the UI where authorized users (including admins) can no longer see buttons or perform actions that depend on these global permissions. Consider using a more inclusive filter (e.g., based on app labels) or expanding the PERMISSIONS whitelist in geonode/security/permissions.py to include all relevant GeoNode global permissions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/gemoni A solution could be to add a method to register new permissions inside the list of global permissions handled by the PermissionsRegistry.

else:
# add custom permissions
perms.add(codename)

# Create a synthetic permission for adding remote resources
if user.is_superuser or user.is_staff or getattr(settings, "REGISTERED_USERS_CAN_ADD_REMOTE_RESOURCES", False):
Expand Down
Loading