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:52:05 +0000 (15:52 -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 e0567d2..a22875e 100644 (file)
@@ -1931,7 +1931,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 617, 'IMPORT_ON_ORDER_CAT_COPY', oils_i18n_gettext( 617,
     'Allows users to import copies based on the on-order items attached to a record', 'ppl', 'description' )),
  ( 618, 'CREATE_PRECAT', oils_i18n_gettext(618,
-    'Allows a user to create a pre-catalogued copy', 'ppl', 'description'))
+    'Allows a user to create a pre-catalogued copy', '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 1d34476..885df71 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', 
@@ -2069,6 +2070,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