Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443488
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443488
Commits
da87545c
Commit
da87545c
authored
15 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#78941
by kkaefer and ksenzee: added missing file.
parent
a86223cd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/user/user.permissions.js
+40
-0
40 additions, 0 deletions
modules/user/user.permissions.js
with
40 additions
and
0 deletions
modules/user/user.permissions.js
0 → 100644
+
40
−
0
View file @
da87545c
// $Id$
(
function
(
$
)
{
/**
* Shows checked and disabled checkboxes for inherited permissions.
*/
Drupal
.
behaviors
.
permissions
=
{
attach
:
function
(
context
)
{
$
(
'
table#permissions:not(.permissions-processed)
'
).
each
(
function
()
{
// Create dummy checkboxes. We use dummy checkboxes instead of reusing
// the existing checkboxes here because new checkboxes don't alter the
// submitted form. If we'd automatically check existing checkboxes, the
// permission table would be polluted with redundant entries. This
// is deliberate, but desirable when we automatically check them.
$
(
'
:checkbox
'
,
this
).
not
(
'
[name^="2["]
'
).
not
(
'
[name^="1["]
'
).
each
(
function
()
{
$
(
this
).
addClass
(
'
real-checkbox
'
);
$
(
'
<input type="checkbox" class="dummy-checkbox" disabled="disabled" checked="checked" />
'
)
.
attr
(
'
title
'
,
Drupal
.
t
(
"
This permission is inherited from the authenticated user role.
"
))
.
hide
()
.
insertAfter
(
this
);
});
// Helper function toggles all dummy checkboxes based on the checkboxes'
// state. If the "authenticated user" checkbox is checked, the checked
// and disabled checkboxes are shown, the real checkboxes otherwise.
var
toggle
=
function
()
{
$
(
this
).
closest
(
'
tr
'
)
.
find
(
'
.real-checkbox
'
)[
this
.
checked
?
'
hide
'
:
'
show
'
]().
end
()
.
find
(
'
.dummy-checkbox
'
)[
this
.
checked
?
'
show
'
:
'
hide
'
]();
};
// Initialize the authenticated user checkbox.
$
(
'
:checkbox[name^="2["]
'
,
this
)
.
click
(
toggle
)
.
each
(
function
()
{
toggle
.
call
(
this
);
});
}).
addClass
(
'
permissions-processed
'
);
}
};
})(
jQuery
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment