refactored permissions for simpler customizations (#808)
This commit is contained in:
@@ -45,9 +45,7 @@ class AboutControllerTest extends ControllerBaseTest
|
||||
$this->assertContains('<h3 class="box-title">PHP</h3>', $content);
|
||||
$this->assertContains('<h3 class="box-title">Server</h3>', $content);
|
||||
|
||||
$this->assertContains('Actions', $content);
|
||||
$this->assertContains('', $content);
|
||||
$this->assertContains('PHP', $content);
|
||||
$this->assertContains('<a href="/en/about/flush-cache"', $content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ class UserControllerTest extends ControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/user/');
|
||||
$this->assertHasDataTable($client);
|
||||
$this->assertDataTableRowCount($client, 'datatable_user_admin', 5);
|
||||
}
|
||||
|
||||
public function testCreateAction()
|
||||
@@ -196,4 +197,18 @@ class UserControllerTest extends ControllerBaseTest
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function testPermissionsIsSecure()
|
||||
{
|
||||
$this->assertUrlIsSecured('/admin/user/permissions');
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_ADMIN, '/admin/user/permissions');
|
||||
}
|
||||
|
||||
public function testPermissions()
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/user/permissions');
|
||||
$this->assertHasDataTable($client);
|
||||
$this->assertDataTableRowCount($client, 'datatable_user_admin_permissions', 66);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ abstract class AbstractVoterTest extends TestCase
|
||||
$roleUser = [];
|
||||
$roleTeamlead = ['view_rate_own_timesheet', 'view_rate_other_timesheet', 'hourly-rate_own_profile'];
|
||||
$roleAdmin = ['hourly-rate_own_profile', 'edit_exported_timesheet'];
|
||||
$roleSuperAdmin = ['hourly-rate_own_profile', 'hourly-rate_other_profile', 'delete_own_profile', 'roles_own_profile', 'system_information', 'system_actions', 'system_configuration', 'plugins', 'edit_exported_timesheet'];
|
||||
$roleSuperAdmin = ['hourly-rate_own_profile', 'hourly-rate_other_profile', 'delete_own_profile', 'roles_own_profile', 'system_information', 'system_configuration', 'plugins', 'edit_exported_timesheet'];
|
||||
|
||||
$permissions = [
|
||||
'ROLE_USER' => array_merge($timesheet, $profile, $roleUser),
|
||||
|
||||
Reference in New Issue
Block a user