mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Merge branch 'cw1998-fix/#1110'
This commit is contained in:
commit
ffceb4092e
@ -55,6 +55,9 @@
|
|||||||
@if(signedInUser() && userCan('settings-manage'))
|
@if(signedInUser() && userCan('settings-manage'))
|
||||||
<a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
|
<a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
|
||||||
@endif
|
@endif
|
||||||
|
@if(signedInUser() && userCan('users-manage') && !userCan('settings-manage'))
|
||||||
|
<a href="{{ baseUrl('/settings/users') }}">@icon('users'){{ trans('settings.users') }}</a>
|
||||||
|
@endif
|
||||||
@if(!signedInUser())
|
@if(!signedInUser())
|
||||||
@if(setting('registration-enabled', false))
|
@if(setting('registration-enabled', false))
|
||||||
<a href="{{ baseUrl("/register") }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
|
<a href="{{ baseUrl("/register") }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
|
||||||
|
@ -109,6 +109,16 @@ class RolesTest extends BrowserKitTest
|
|||||||
->seePageIs('/settings/users');
|
->seePageIs('/settings/users');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_manage_users_permission_shows_link_in_header_if_does_not_have_settings_manage_permision()
|
||||||
|
{
|
||||||
|
$usersLink = 'href="'.url('/settings/users') . '"';
|
||||||
|
$this->actingAs($this->user)->visit('/')->dontSee($usersLink);
|
||||||
|
$this->giveUserPermissions($this->user, ['users-manage']);
|
||||||
|
$this->actingAs($this->user)->visit('/')->see($usersLink);
|
||||||
|
$this->giveUserPermissions($this->user, ['settings-manage', 'users-manage']);
|
||||||
|
$this->actingAs($this->user)->visit('/')->dontSee($usersLink);
|
||||||
|
}
|
||||||
|
|
||||||
public function test_user_roles_manage_permission()
|
public function test_user_roles_manage_permission()
|
||||||
{
|
{
|
||||||
$this->actingAs($this->user)->visit('/settings/roles')
|
$this->actingAs($this->user)->visit('/settings/roles')
|
||||||
|
Loading…
Reference in New Issue
Block a user