X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fruntime%2Forg.argeo.security.ria%2Fsrc%2Fargeo-ria-lib%2Fsecurity%2Fclass%2Forg%2Fargeo%2Fsecurity%2Fria%2FRolesApplet.js;h=429460b3700d2258910ad6b3ed3f57bed0da3de7;hb=06f80b7b50619d1c997e2660eddb32a584cfc8a8;hp=f2f488d31a3220a38d4a93f35a773b2a2e992522;hpb=829163c2a8aa042407a6fd2ee45d10cea69e933f;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js index f2f488d31..429460b37 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js @@ -28,34 +28,64 @@ qx.Class.define("org.argeo.security.ria.RolesApplet", */ commands : { init : { + "reload" : { + label : "Reload Data", + icon : "org.argeo.security.ria/view-refresh.png", + shortcut : "Control+h", + enabled : true, + menu : "Roles", + toolbar : "roles", + callback : function(e){ + this.loadRolesList(); + }, + command : null + }, "new_role" : { label : "Create Role", icon : "org.argeo.security.ria/list-add.png", - shortcut : "Control+n", + shortcut : null, enabled : true, menu : "Roles", - toolbar : "role", + toolbar : null, callback : function(e){ // Prompt for new name + var modal = new org.argeo.ria.components.Modal(); + modal.makePromptForm("Please enter a role name", function(roleName){ + var service = org.argeo.security.ria.SecurityAPI.getCreateRoleService(roleName); + service.addListener("completed", function(response){ + this.loadRolesList(); + }, this); + service.send(); + }, this); + modal.attachAndShow(); }, command : null }, "delete_role" : { label : "Delete Role", icon : "org.argeo.security.ria/list-remove.png", - shortcut : "Control+s", + shortcut : null, enabled : true, menu : "Roles", - toolbar : "role", + toolbar : null, callback : function(e){ // Call service to delete - var crtUsers = this.getViewSelection().getNodes(); - for(var i=0;i