Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added profile detail permissions

  • Loading branch information...
commit d48698c21611b9de0830578bab4f57ed69e61126 1 parent 7f4f949
@brosner brosner authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 idios/views.py
View
8 idios/views.py
@@ -92,11 +92,15 @@ def get_object(self):
if idios.settings.USE_USERNAME:
self.page_user = get_object_or_404(User, username=self.kwargs["username"])
- return get_object_or_404(profile_class, user=self.page_user)
+ profile = get_object_or_404(profile_class, user=self.page_user)
else:
profile = get_object_or_404(profile_class, pk=self.kwargs["pk"])
self.page_user = profile.user
- return profile
+
+ if not self.request.user.has_perm("can_view", obj=profile):
+ raise Http404
+
+ return profile
def get_context_data(self, **kwargs):
base_profile_class = get_profile_base()
Please sign in to comment.
Something went wrong with that request. Please try again.