Permalink
Browse files

added profile detail permissions

  • Loading branch information...
1 parent 7f4f949 commit d48698c21611b9de0830578bab4f57ed69e61126 @brosner brosner committed Jan 27, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 idios/views.py
View
@@ -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()

0 comments on commit d48698c

Please sign in to comment.