mirror of
https://github.com/kakwa/ldapcherry
synced 2025-07-03 11:57:41 +02:00
implementing notification to explain automatic adding of roles
This commit is contained in:
parent
5ddaa4c44f
commit
6eece6f7ff
3 changed files with 22 additions and 4 deletions
|
@ -34,6 +34,7 @@
|
|||
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="/static/js/scripts.js"></script>
|
||||
<script type="text/javascript" src="/static/js/validator.js"></script>
|
||||
<script type="text/javascript" src="/static/js/bootstrap-notify.js"></script>
|
||||
<script type="text/javascript" src="/static/js/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="/static/js/bootstrap-switch.js"></script>
|
||||
|
||||
|
|
|
@ -1,19 +1,32 @@
|
|||
<script type="text/javascript">
|
||||
var roles = ${graph_js};
|
||||
var graph = ${graph_js};
|
||||
var roles = ${roles_js};
|
||||
function enableParentRoles(roleid){
|
||||
var parentRoles = roles[roleid]['parent_roles'];
|
||||
var parentRoles = graph[roleid]['parent_roles'];
|
||||
var DnRole = roles[roleid];
|
||||
var len = parentRoles.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
var role = parentRoles[i];
|
||||
var DnParentRole = roles[role];
|
||||
var checked = document.getElementById(role).checked;
|
||||
$('input[name=' + role +']').bootstrapSwitch('state', true, true);
|
||||
if ( ! checked){
|
||||
$.notify("Added Role '" + DnParentRole + "' (Parent Role of '" + DnRole +"')");
|
||||
}
|
||||
}
|
||||
}
|
||||
function disableSubRoles(roleid){
|
||||
var parentRoles = roles[roleid]['sub_roles'];
|
||||
var parentRoles = graph[roleid]['sub_roles'];
|
||||
var DnRole = roles[roleid];
|
||||
var len = parentRoles.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
var role = parentRoles[i];
|
||||
var DnParentRole = roles[role];
|
||||
var checked = document.getElementById(role).checked;
|
||||
$('input[name=' + role +']').bootstrapSwitch('state', false, true);
|
||||
if (checked){
|
||||
$.notify("Removed Role '" + DnParentRole + "' (Sub Role of '" + DnRole +"')");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue