X-Git-Url: http://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=3803968a9a9a797f33d730eb131dd3f1a4d0dbfb;hpb=81579a12a1b3fa8a21e1ad7944e5dccaa8beeadf;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 3803968a9..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,13 +28,75 @@ 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 : null, + enabled : true, + menu : "Roles", + 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 : null, + enabled : true, + menu : "Roles", + toolbar : null, + callback : function(e){ + // Call service to delete + var roles = this.getViewSelection().getNodes(); + var modal = new org.argeo.ria.components.Modal("Delete"); + modal.addConfirm("Are you sure you want to delete the selected roles?"); + modal.addListener("ok", function(e){ + for(var i=0;i