}
}
+ /**
+ * 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();
--- /dev/null
+@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"
color: #3a87ad;
background-color: #d9edf7;
}
+#overriderolestable .overriddenpermission {
+ background-color: #fcf8e3;
+}
/* calendar.less */
.calendar_event_course {
background-color: #ffd3bd;