From 1a25eca932b6121fa24406a073052884ddb44412 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 Signed-off-by: Mike Rylander Signed-off-by: Jane Sandberg --- 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 | 2 ++ 3 files changed, 15 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 e0567d2236..a22875e4bb 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -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 index 0000000000..2a12998264 --- /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 +( 619, 'EDIT_SELF_IN_CLIENT', oils_i18n_gettext(619, + '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 1d34476fef..885df71bc9 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 @@ -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 -- 2.11.0