LP 1648918: Remove Workstation at Root of User's Permission Tree
authorJason Stephenson <jason@sigio.com>
Sat, 10 Dec 2016 01:45:33 +0000 (20:45 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 10 Feb 2017 22:04:21 +0000 (17:04 -0500)
If you register a workstation at the root of the user's permission
tree in the webstaff client, you are not able to later remove it.  The
Remove button is dimmed.  You can remove a workstation registered at
any other org_unit where the user has the REGISTER_WORKSTATION
permission.

To reproduce this bug, login as the admin user and register a
workstation at the CONS org_unit.  Then, go to Workstation
Administration and see that the Remove button is dimmed.

To test the patch, do the same, but see that the Remove button is not
dimmed.  When you click it, the workstation is also removed.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/web/js/ui/default/staff/admin/workstation/app.js

index c8bcb60..9723c02 100644 (file)
@@ -817,7 +817,7 @@ function($scope , $q , $window , $location , egCore , egAlertDialog , workstatio
     $scope.can_delete_ws = function(name) {
         var ws = all_workstations.filter(
             function(ws) { return ws.name == name })[0];
-        return ws && reg_perm_orgs.indexOf(ws.owning_lib);
+        return ws && reg_perm_orgs.indexOf(ws.owning_lib) != -1;
     }
 
     $scope.remove_ws = function(remove_me) {