Skip to content

Commit

Permalink
Merge pull request #6528 from miguelvazq/HPCC-12234
Browse files Browse the repository at this point in the history
HPCC-12234 - Should warn if admin is removed

Reviewed-By: Gordon Smith <gordon.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
  • Loading branch information
richardkchapman committed Nov 3, 2014
2 parents 4aa66e7 + c574669 commit cedce94
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
20 changes: 19 additions & 1 deletion esp/src/eclwatch/MemberOfWidget.js
Expand Up @@ -25,17 +25,19 @@ define([

"hpcc/GridDetailsWidget",
"hpcc/ws_access",
"hpcc/ws_account",
"hpcc/ESPUtil"

], function (declare, lang, i18n, nlsHPCC,
registry,
editor,
GridDetailsWidget, WsAccess, ESPUtil) {
GridDetailsWidget, WsAccess, WsAccount, ESPUtil) {
return declare("MemberOfWidget", [GridDetailsWidget], {
i18n: nlsHPCC,

gridTitle: nlsHPCC.title_MemberOf,
idProperty: "__hpcc_id",
currentUser: null,

// Hitched Actions ---
_onRefresh: function (args) {
Expand All @@ -44,11 +46,27 @@ define([

// Implementation ---
init: function (params) {
var context = this;
if (this.inherited(arguments))
return;

WsAccount.MyAccount({
}).then(function (response) {
if (lang.exists("MyAccountResponse.username", response)) {
context.currentUser = response.MyAccountResponse.username;
}
});

this.store = WsAccess.CreateGroupsStore(params.username, false);
this.grid.setStore(this.store);
this.grid.on("dgrid-datachange", function(event){
if (dojoConfig.isAdmin && params.username === context.currentUser && event.oldValue === true) {
var msg = confirm(context.i18n.RemoveUser + " " + event.rowId + ". " + context.i18n.ConfirmRemoval);
if (!msg){
event.preventDefault();
}
}
});
this._refreshActionState();
},

Expand Down
2 changes: 2 additions & 0 deletions esp/src/eclwatch/nls/es/hpcc.js
Expand Up @@ -65,6 +65,7 @@ define(
Compressed: "Comprimido",
Configuration: "Configuracion",
ConfirmPassword: "Confirme la Contraseña",
ConfirmRemoval: "¿Seguro que quieres hacer esto?",
Content: "Contenido",
Contents: "Contenidos",
ContentType: "Tipo de Contenido",
Expand Down Expand Up @@ -359,6 +360,7 @@ define(
RemoteDali: "Dali remoto",
RemoteDaliIP: "Remote&nbsp;Dali&nbsp;IP&nbsp;Address",
Remove: "Remover",
RemoveUser: "Esta apunto de excluirse del grupo:",
Rename: "Renombrar",
RenderedSVG: "SVG creado",
RenderSVG: "Crear SVG",
Expand Down
2 changes: 2 additions & 0 deletions esp/src/eclwatch/nls/hpcc.js
Expand Up @@ -62,6 +62,7 @@ define({root:
Compressed: "Compressed",
Configuration: "Configuration",
ConfirmPassword: "Confirm Password",
ConfirmRemoval: "Are you sure you want to do this?",
Content: "Content",
Contents: "Contents",
ContentType: "Content Type",
Expand Down Expand Up @@ -363,6 +364,7 @@ define({root:
RemoteDali: "Remote Dali",
RemoteDaliIP: "Remote Dali IP Address",
Remove: "Remove",
RemoveUser: "You are about to remove yourself from the group:",
Rename: "Rename",
RenderedSVG: "Rendered SVG",
RenderSVG: "Render SVG",
Expand Down

0 comments on commit cedce94

Please sign in to comment.