Commit be194e5a8cc1380335860a99d1a7f312ced08e5b
1 parent
d03fb471
Exists in
master
and in
22 other branches
ActionItem295: giving members the hability to see private content
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1820 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
app/models/profile.rb
| @@ -286,8 +286,12 @@ class Profile < ActiveRecord::Base | @@ -286,8 +286,12 @@ class Profile < ActiveRecord::Base | ||
| 286 | if self.public_profile | 286 | if self.public_profile |
| 287 | true | 287 | true |
| 288 | else | 288 | else |
| 289 | - # other possibilities would come here | ||
| 290 | - (user == self) | 289 | + if user.nil? |
| 290 | + false | ||
| 291 | + else | ||
| 292 | + # other possibilities would come here | ||
| 293 | + (user == self) || (user.memberships.include?(self)) | ||
| 294 | + end | ||
| 291 | end | 295 | end |
| 292 | end | 296 | end |
| 293 | 297 |