LP#1842940: add perm to permit staff to edit their own accounts in the client
authorJeff Davis <jeff.davis@bc.libraries.coop>
Thu, 5 Sep 2019 17:23:55 +0000 (10:23 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Tue, 1 Oct 2019 22:00:50 +0000 (15:00 -0700)
Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1842940_staff_edit_self_perm.sql [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js

index c692cc6..8c0d5fd 100644 (file)
@@ -1915,7 +1915,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 609, 'MANAGE_CUSTOM_PERM_GRP_TREE', oils_i18n_gettext( 609,
     'Allows a user to manage custom permission group lists.', 'ppl', 'description' )),
  ( 610, 'CLEAR_PURCHASE_REQUEST', oils_i18n_gettext(610,
-    'Clear Completed User Purchase Requests', 'ppl', 'description'))
+    'Clear Completed User Purchase Requests', 'ppl', 'description')),
+ ( 619, 'EDIT_SELF_IN_CLIENT', oils_i18n_gettext(619,
+    'Allow a user to edit their own account in the staff client', 'ppl', 'description'))
 ;
 
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1842940_staff_edit_self_perm.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1842940_staff_edit_self_perm.sql
new file mode 100644 (file)
index 0000000..2a12998
--- /dev/null
@@ -0,0 +1,10 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO permission.perm_list ( id, code, description ) VALUES
+( 619, 'EDIT_SELF_IN_CLIENT', oils_i18n_gettext(619,
+    'Allow a user to edit their own account in the staff client', 'ppl', 'description'))
+;
+
+COMMIT;
index de0034d..b39bf1f 100644 (file)
@@ -246,6 +246,7 @@ angular.module('egCoreMod')
     service.has_perms_for_org = function(org_id) {
 
         var perms_needed = [
+            'EDIT_SELF_IN_CLIENT',
             'UPDATE_USER',
             'CREATE_USER',
             'CREATE_USER_GROUP_LINK', 
@@ -2068,6 +2069,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
     $scope.edit_passthru.hide_save_actions = function() {
         if ($scope.patron.id
             && $scope.patron.id == egCore.auth.user().id()
+            && !$scope.perms.EDIT_SELF_IN_CLIENT
         ) return true;
 
         if ( $scope.patron.profile