Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / user / user.permissions.js
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function ($, Drupal) {
9   Drupal.behaviors.permissions = {
10     attach: function attach(context) {
11       var self = this;
12       $('table#permissions').once('permissions').each(function () {
13         var $table = $(this);
14         var $ancestor = void 0;
15         var method = void 0;
16         if ($table.prev().length) {
17           $ancestor = $table.prev();
18           method = 'after';
19         } else {
20           $ancestor = $table.parent();
21           method = 'append';
22         }
23         $table.detach();
24
25         var $dummy = $('<input type="checkbox" class="dummy-checkbox js-dummy-checkbox" disabled="disabled" checked="checked" />').attr('title', Drupal.t('This permission is inherited from the authenticated user role.')).hide();
26
27         $table.find('input[type="checkbox"]').not('.js-rid-anonymous, .js-rid-authenticated').addClass('real-checkbox js-real-checkbox').after($dummy);
28
29         $table.find('input[type=checkbox].js-rid-authenticated').on('click.permissions', self.toggle).each(self.toggle);
30
31         $ancestor[method]($table);
32       });
33     },
34     toggle: function toggle() {
35       var authCheckbox = this;
36       var $row = $(this).closest('tr');
37
38       $row.find('.js-real-checkbox').each(function () {
39         this.style.display = authCheckbox.checked ? 'none' : '';
40       });
41       $row.find('.js-dummy-checkbox').each(function () {
42         this.style.display = authCheckbox.checked ? '' : 'none';
43       });
44     }
45   };
46 })(jQuery, Drupal);