mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-56581 Roles: Permissions override screen not inherited styling
This commit is contained in:
parent
863e1a66a9
commit
e985a29cdf
@ -56,6 +56,24 @@ class core_role_override_permissions_table_advanced extends core_role_capability
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method adds an additional class to a row if capability is other than inherited.
|
||||
*
|
||||
* @param stdClass $capability
|
||||
* @return array
|
||||
*/
|
||||
protected function get_row_attributes($capability) {
|
||||
$rowattributes = parent::get_row_attributes($capability);
|
||||
if ($this->permissions[$capability->name] !== 0) {
|
||||
if (empty($rowattributes['class'])) {
|
||||
$rowattributes['class'] = "overriddenpermission";
|
||||
} else {
|
||||
$rowattributes['class'] .= " overriddenpermission";
|
||||
}
|
||||
}
|
||||
return $rowattributes;
|
||||
}
|
||||
|
||||
protected function load_parent_permissions() {
|
||||
// Get the capabilities from the parent context, so that can be shown in the interface.
|
||||
$parentcontext = $this->context->get_parent_context();
|
||||
|
23
admin/roles/tests/behat/override_roles_highlighting.feature
Normal file
23
admin/roles/tests/behat/override_roles_highlighting.feature
Normal file
@ -0,0 +1,23 @@
|
||||
@core @core_admin @core_admin_roles
|
||||
Feature: Highlight non-inherited permissions
|
||||
In order that the status of capabilities can be more easily seen
|
||||
As an admin
|
||||
I need altered permissions to be highlighted
|
||||
|
||||
Background:
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname |
|
||||
| Course fullname | C_shortname |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
|
||||
@javascript
|
||||
Scenario: Override a permission
|
||||
Given I follow "Course fullname"
|
||||
When I expand "Users" node
|
||||
And I follow "Permissions"
|
||||
And I select "1" from the "roleid" singleselect
|
||||
And I click on "Prohibit" "radio" in the "View added and updated modules in recent activity block" "table_row"
|
||||
And I press "Save changes"
|
||||
And I select "1" from the "roleid" singleselect
|
||||
Then the "class" attribute of "View added and updated modules in recent activity block" "table_row" should contain "overriddenpermission"
|
@ -850,3 +850,7 @@ img.iconsmall {
|
||||
color: @infoText;
|
||||
background-color: @infoBackground;
|
||||
}
|
||||
|
||||
#overriderolestable .overriddenpermission {
|
||||
background-color: @warningBackground;
|
||||
}
|
||||
|
@ -3234,6 +3234,9 @@ img.iconsmall {
|
||||
color: #3a87ad;
|
||||
background-color: #d9edf7;
|
||||
}
|
||||
#overriderolestable .overriddenpermission {
|
||||
background-color: #fcf8e3;
|
||||
}
|
||||
/* calendar.less */
|
||||
.calendar_event_course {
|
||||
background-color: #ffd3bd;
|
||||
|
Loading…
x
Reference in New Issue
Block a user