__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
@core @core_admin
Feature: Staff can check user permissions
In order to find out whether a user can or can't do something
As an admin
I can check their permissions in a particular context
Background:
Given the following "custom profile fields" exist:
| datatype | shortname | name |
| text | frog | Favourite frog |
And the following config values are set as admin:
| showuseridentity | email,profile_field_frog |
And the following "users" exist:
| username | firstname | lastname | email | profile_field_frog |
| user1 | User | One | one@example.com | Kermit |
| user2 | User | Two | two@example.com | Tree |
| user3 | User | Three | thr@example.com | Kermit |
And the following "courses" exist:
| shortname | fullname |
| C1 | Course 1 |
| C2 | Course 2 |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | editingteacher |
| user2 | C1 | editingteacher |
| user3 | C2 | editingteacher |
@javascript
Scenario: Search for a user (enrolled on the course) by custom field and select them to see permissions
When I am on the "C1" "permissions" page logged in as "admin"
And I set the field "Participants tertiary navigation" to "Check permissions"
And I set the field "Search" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
Then "optgroup[label='Matching enrolled users (1)']" "css_element" should exist
And I should see "User One (one@example.com, Kermit)"
And I should not see "User Two"
And I set the field "reportuser" to "User One (one@example.com, Kermit)"
And I press "Show this user's permissions"
And I should see "Permissions for user User One"
And I should see "Yes" in the "Add a new forum" "table_row"
@javascript
Scenario: Search for a user (not enrolled on the course) by custom field and select them to see permissions
When I am on the "C1" "permissions" page logged in as "admin"
And I set the field "Participants tertiary navigation" to "Check permissions"
And I set the field "Search" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
Then "optgroup[label*='Potential users matching'][label*=' (1)']" "css_element" should exist
And I should see "User Three (thr@example.com, Kermit)"
And I should not see "User Two"
And I set the field "reportuser" to "User Three (thr@example.com, Kermit)"
And I press "Show this user's permissions"
Then I should see "Permissions for user User Three"
And I should see "No" in the "Add a new forum" "table_row"
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| assign.feature | File | 4.13 KB | 0777 |
|
| behat_admin.php | File | 5.19 KB | 0777 |
|
| browse_users.feature | File | 11.95 KB | 0777 |
|
| check.feature | File | 2.74 KB | 0777 |
|
| display_short_names.feature | File | 858 B | 0777 |
|
| enable_multiple_accounts_use_same_email.feature | File | 3.23 KB | 0777 |
|
| filter_users.feature | File | 11.17 KB | 0777 |
|
| invalid_allcountrycodes.feature | File | 1.41 KB | 0777 |
|
| language_settings.feature | File | 1.35 KB | 0777 |
|
| manage_blocks.feature | File | 2.45 KB | 0777 |
|
| manage_media.feature | File | 806 B | 0777 |
|
| moodlenet_outbound.feature | File | 2.5 KB | 0777 |
|
| outgoing_mail.feature | File | 1.29 KB | 0777 |
|
| plugins_overview.feature | File | 2.25 KB | 0777 |
|
| purge_caches.feature | File | 1.4 KB | 0777 |
|
| resetindentation.feature | File | 6.61 KB | 0777 |
|
| search_areas.feature | File | 1.02 KB | 0777 |
|
| set_admin_settings_value.feature | File | 895 B | 0777 |
|
| site_administration.feature | File | 1.01 KB | 0777 |
|
| task_logs.feature | File | 2.32 KB | 0777 |
|