LP#1842940: add perm to permit staff to edit their own accounts in the client user/jeffdavis/lp1842940-user-edit-restrictions-perm
authorJeff Davis <jeff.davis@bc.libraries.coop>
Thu, 5 Sep 2019 17:23:55 +0000 (10:23 -0700)
committerJeff Davis <jeff.davis@bc.libraries.coop>
Thu, 5 Sep 2019 17:41:41 +0000 (10:41 -0700)
Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
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 f2c6e85..97268db 100644 (file)
@@ -1923,7 +1923,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 613, 'ADMIN_CAROUSEL', oils_i18n_gettext(613,
     'Allow a user to manage carousels', 'ppl', 'description')),
  ( 614, 'REFRESH_CAROUSEL', oils_i18n_gettext(614,
-    'Allow a user to refresh carousels', 'ppl', 'description'))
+    'Allow a user to refresh carousels', 'ppl', 'description')),
+ ( 615, 'EDIT_SELF_IN_CLIENT', oils_i18n_gettext(615,
+    '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..817211e
--- /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
+( 615, 'EDIT_SELF_IN_CLIENT', oils_i18n_gettext(615,
+    'Allow a user to edit their own account in the staff client', 'ppl', 'description'))
+;
+
+COMMIT;
index de0034d..a68a429 100644 (file)
@@ -2068,6 +2068,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