|
|
@@ -40,7 +40,7 @@ ${ layout.menubar(section=component) }
|
|
|
<span class="pointer" data-bind="visible: privilegesForViewTo() < privileges().length, click: function(){ privilegesForViewTo(privilegesForViewTo() + 50) }" title="${ _('Show 50 more...') }"><i class="fa fa-ellipsis-h"></i></span>
|
|
|
<span class="pointer" data-bind="click: addPrivilege, visible: $root.is_sentry_admin" title="${ _('Add privilege') }"><i class="fa fa-plus"></i></span>
|
|
|
<span class="pointer" data-bind="click: function() { $root.list_sentry_privileges_by_authorizable() }, visible: privilegesChanged().length > 0" title="${ _('Undo') }"> <i class="fa fa-undo"></i></span>
|
|
|
- <span class="pointer" data-bind="click: function() { huePubSub.publish('delete.privilege.modal', $data) }, visible: privilegesChanged().length > 0" title="${ _('Save') }"> <i class="fa fa-save"></i></span>
|
|
|
+ <span class="pointer" data-bind="click: function() { $root.deletePrivilegeModal($data) }, visible: privilegesChanged().length > 0" title="${ _('Save') }"> <i class="fa fa-save"></i></span>
|
|
|
</div>
|
|
|
<!-- /ko -->
|
|
|
</script>
|
|
|
@@ -416,7 +416,7 @@ ${ layout.menubar(section=component) }
|
|
|
<div class="acl-block acl-actions" data-bind="click: privilegesChanged().length == 0 ? addPrivilege : void(0), visible: $root.is_sentry_admin">
|
|
|
<span class="pointer" data-bind="click: addPrivilege, visible: $data.showPrivileges" title="${ _('Add privilege') }"><i class="fa fa-plus"></i></span>
|
|
|
<span class="pointer" data-bind="click: $root.list_sentry_privileges_by_role, visible: privilegesChanged().length > 0" title="${ _('Undo') }"> <i class="fa fa-undo"></i></span>
|
|
|
- <span class="pointer" data-bind="click: function() { huePubSub.publish('delete.privilege.modal', $data) }, visible: privilegesChanged().length > 0 && isValid()" title="${ _('Save') }"> <i class="fa fa-save"></i></span>
|
|
|
+ <span class="pointer" data-bind="click: function() { $root.deletePrivilegeModal($data) }, visible: privilegesChanged().length > 0 && isValid()" title="${ _('Save') }"> <i class="fa fa-save"></i></span>
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
@@ -624,17 +624,8 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
(function () {
|
|
|
- huePubSub.subscribe('delete.privilege.modal', function (role) {
|
|
|
- var cascadeDeletes = $.grep(role.privilegesChanged(), function (privilege) {
|
|
|
- return privilege.status() == 'deleted' && (privilege.privilegeType() == 'SERVER' || privilege.privilegeType() == 'DATABASE');
|
|
|
- }
|
|
|
- );
|
|
|
- if (cascadeDeletes.length > 0) {
|
|
|
- viewModel.roleToUpdate(role);
|
|
|
- $('#deletePrivilegeModal').modal('show');
|
|
|
- } else {
|
|
|
- viewModel.role().savePrivileges(role);
|
|
|
- }
|
|
|
+ huePubSub.subscribe('show.delete.privilege.modal', function () {
|
|
|
+ $('#deletePrivilegeModal').modal('show');
|
|
|
});
|
|
|
|
|
|
var viewModel = new SentryViewModel(${ initial | n,unicode });
|