Commit 19150231 authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-4528 Add administer users permission to site owner role

parent fdaff5fb
......@@ -80,6 +80,8 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->dashboardTest();
$this->ctaBlockTest();
$this->permissionsTest();
}
/**
......@@ -868,4 +870,31 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->assertSession()->pageTextContains($cta_label);
}
/**
* Tests permissions.
*
* Site owner role has administer users permission.
*/
private function permissionsTest() {
// Only administer can access.
$this->drupalLogin($this->drupalUsers['administrator']);
$this->drupalGet('admin/people/permissions');
$this->assertSession()->statusCodeEquals(200);
$this->assertFieldChecked('edit-uw-role-site-owner-administer-users');
// The other users do not have access.
$roles = [
'authenticated user',
'uw_role_site_manager',
'uw_role_content_editor',
'uw_role_content_author',
'uw_role_form_editor',
'uw_role_form_results_access',
];
foreach ($roles as $role) {
$this->drupalLogin($this->drupalUsers[$role]);
$this->drupalGet('admin/people/permissions');
$this->assertSession()->statusCodeEquals(403);
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment