Skip to content

Commit

Permalink
Changed check_access() to use the same user reference to retrieve per…
Browse files Browse the repository at this point in the history
…missions as used earlier in the method to check authentication

Using the context for the later check can break under certain conditions
  • Loading branch information
Bartvaderkin committed Jun 18, 2020
1 parent 6c545b1 commit 70786a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sitetree/sitetreeapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ def check_access(self, item: 'TreeItemBase', context: Context) -> bool:
user_perms = self._current_user_permissions

if user_perms is _UNSET:
user_perms = self.get_permissions(context['user'], item)
user_perms = self.get_permissions(self.current_request.user, item)
self._current_user_permissions = user_perms

if item.access_perm_type == MODEL_TREE_ITEM_CLASS.PERM_TYPE_ALL:
Expand Down

0 comments on commit 70786a0

Please sign in to comment.