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['user'] for the later check can break under certain conditions (ex. template-tags that customize context)
  • Loading branch information
Bartvaderkin committed Jun 29, 2020
1 parent 871ce7d commit a120bb0
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 @@ -916,7 +916,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 a120bb0

Please sign in to comment.