mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Guest control: Cleaned methods involved in fetching/handling
- Moves guest user caching from User class to app container for simplicity. - Updates test to use simpler $this->users->guest() method for consistency. - Streamlined helpers to avoid function overlap for simplicity. - Extracted user profile dropdown while doing changes.
This commit is contained in:
@@ -57,8 +57,7 @@ class UserSearchTest extends TestCase
|
||||
public function test_select_requires_logged_in_user()
|
||||
{
|
||||
$this->setSettings(['app-public' => true]);
|
||||
$defaultUser = User::getDefault();
|
||||
$this->permissions->grantUserRolePermissions($defaultUser, ['users-manage']);
|
||||
$this->permissions->grantUserRolePermissions($this->users->guest(), ['users-manage']);
|
||||
|
||||
$resp = $this->get('/search/users/select?search=a');
|
||||
$this->assertPermissionError($resp);
|
||||
|
Reference in New Issue
Block a user