Skip to content

Commit

Permalink
[Fixes #12512] Expose publish, approval and feature permissions insid…
Browse files Browse the repository at this point in the history
…e PermissionLevelMixin
  • Loading branch information
mattiagiupponi committed Aug 21, 2024
1 parent 030638e commit 089bb06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions geonode/security/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,7 @@ def user_can(self, user, permission):
"""
Checks if a has a given permission to the resource.
"""
resource = self.get_self_resource()
user_perms = resource.get_user_perms(user)
user_perms = self.get_user_perms(user)

if permission not in user_perms:
# TODO cater for permissions with syntax base.permission_codename
Expand Down
4 changes: 2 additions & 2 deletions geonode/security/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ def test_set_compact_permissions(self):
"view_resourcebase",
"download_resourcebase",
"change_resourcebase_metadata",
"approve_resourcebase"
"approve_resourcebase",
],
self.anonymous_user: ["view_resourcebase"],
},
Expand Down Expand Up @@ -2149,7 +2149,7 @@ def test_permissions_on_user_role_promotion_to_manager(self):
"view_resourcebase",
"publish_resourcebase",
"change_resourcebase_permissions",
"approve_resourcebase"
"approve_resourcebase",
],
}
try:
Expand Down

0 comments on commit 089bb06

Please sign in to comment.