Skip to content

Commit

Permalink
fixes /community/joinList?id=* that access block is not considered (f…
Browse files Browse the repository at this point in the history
…ixes #2636)
  • Loading branch information
upsilon authored and nishizoe committed Feb 8, 2017
1 parent 736bea3 commit 20d13f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/action/opCommunityAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public function executeJoinlist(opWebRequest $request)

$this->member = Doctrine::getTable('Member')->find($memberId);
$this->forward404Unless($this->member);
$this->forward404Unless($this->member->isAllowed($this->getUser()->getMember(), 'view'));

if (!$this->size)
{
Expand Down
15 changes: 15 additions & 0 deletions test/functional/pc_frontend/communityActionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@
->with('response')->isStatusCode(200)
;

$user->login('[email protected]', 'password');
$user
->info('4. Testing `/community/joinList?id=*`')
->get('/community/joinList?id=1')
->info('4-1. Member E cannot view the list of communities joined by Member A (Access blocked)')
->checkDispatch('community', 'joinlist')
->isStatusCode(404)
->get('/community/joinList?id=2')
->info('4-2. Member E can view the list of communities joined by Member B (Normal behavior)')
->checkDispatch('community', 'joinlist')
->isStatusCode(200)
->with('response')
->checkElement('#communityList tr.text a', 5) // 5 communities
;

$user->login('[email protected]', 'password');
$user
->info('community/search')
Expand Down

0 comments on commit 20d13f4

Please sign in to comment.