mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Guests: Prevented access to profile routes
Prevention of action on certain routes for guest user when public access is enabled. Could not see a way this could be a security issue, beyond a mild nuisance that'd only be visible if public users can edit, which would present larger potential nuisance anyway.
This commit is contained in:
@ -207,4 +207,16 @@ class PublicActionTest extends TestCase
|
||||
|
||||
$this->withHtml($resp)->assertLinkExists($page->getUrl('/edit'));
|
||||
}
|
||||
|
||||
public function test_public_user_cannot_view_or_update_their_profile()
|
||||
{
|
||||
$this->setSettings(['app-public' => 'true']);
|
||||
$guest = $this->users->guest();
|
||||
|
||||
$resp = $this->get($guest->getEditUrl());
|
||||
$this->assertPermissionError($resp);
|
||||
|
||||
$resp = $this->put($guest->getEditUrl(), ['name' => 'My new guest name']);
|
||||
$this->assertPermissionError($resp);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user