RE: Profiles, public != visitor. fixes #10907

This commit is contained in:
Colin Kuskie 2009-09-06 19:37:25 -07:00
parent cba211392e
commit 1e98e34128
3 changed files with 3 additions and 1 deletions

View file

@ -15,6 +15,7 @@
- fixed #10879: Collaboration System Thread lose attachments
- fixed #10876: EMS Schedule displaying wrong dates for ticket events
- fixed #10915: StoryManager: Carousel clips content
- fixed #10907: profiles viewable by everybody
7.7.19
- fixed #10838: Forwarded forum post email to new CS adds reply to original thread

View file

@ -1207,6 +1207,7 @@ sub profileIsViewable {
my $userId = $user->userId;
return 0 if ($self->isVisitor); #Can't view visitor's profile
return 0 if ($user->isVisitor); #User is not allowed to see anyone's profile, either
return 1 if ($self->userId eq $userId); #Users can always view their own profile
my $profileSetting = $self->profileField('publicProfile');

View file

@ -917,7 +917,7 @@ ok(! $neighbor->profileIsViewable($friend), '... visitor permission follows publ
ok(! $neighbor->profileIsViewable($admin), '... visitor permission follows publicProfile=none, even admin');
$neighbor->profileField('publicProfile', 'all');
ok( $neighbor->profileIsViewable($friend), '... visitor permission follows publicProfile=all');
ok( $neighbor->profileIsViewable($visitor), '... visitor permission follows publicProfile=all, even visitor');
ok(! $neighbor->profileIsViewable($visitor), '... visitor may not see profiles, regardless of privacy setting');
$neighbor->profileField('publicProfile', 'friends');
ok(! $neighbor->profileIsViewable($friend), '... visitor permission follows publicProfile=friend, not a friend');
$friend->addToGroups([$neighbor->friends->getId]);