From 3883f4d0760d46c06a7cc559eb908babfa167588 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Thu, 5 Sep 2019 10:23:55 -0700 Subject: [PATCH] LP#1842940: add perm to permit staff to edit their own accounts in the client Signed-off-by: Jeff Davis --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 4 +++- .../Pg/upgrade/XXXX.data.lp1842940_staff_edit_self_perm.sql | 10 ++++++++++ Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1842940_staff_edit_self_perm.sql diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index f2c6e85de2..97268dbbb2 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -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 index 0000000000..817211eeab --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1842940_staff_edit_self_perm.sql @@ -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; diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index de0034db49..a68a429598 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -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 -- 2.11.0