Skip to content

Commit

Permalink
fix(#8886): block users from editing important fields in their settings
Browse files Browse the repository at this point in the history
  • Loading branch information
garethbowen committed May 16, 2024
1 parent fed3e2b commit b0fa207
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 768 deletions.
12 changes: 9 additions & 3 deletions admin/src/js/controllers/display-privacy-policies-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ angular
$sanitize,
$scope,
$timeout,
$uibModalInstance,
PrivacyPolicies
$uibModalInstance
) {
'use strict';
'ngInject';

const getHtml = string => {
return $sanitize(PrivacyPolicies.decodeUnicode(string));
// atob doesn't handle unicode characters
// stolen from StackOverflow
// Going backwards: from byte stream, to percent-encoding, to original string.
const unicodeCharArray = atob(string)
.split('')
.map(char => '%' + ('00' + char.charCodeAt(0).toString(16)).slice(-2))
.join('');
return $sanitize(decodeURIComponent(unicodeCharArray));
};

$scope.cancel = () => $uibModalInstance.dismiss();
Expand Down
1 change: 0 additions & 1 deletion admin/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ require('./services/lineage-model-generator');
require('./services/location');
require('./services/modal');
require('./services/moment-locale-data');
require('./services/privacy-policies');
require('./services/resource-icons');
require('./services/search');
require('./services/select2-search');
Expand Down
147 changes: 0 additions & 147 deletions admin/src/js/services/privacy-policies.js

This file was deleted.

Loading

0 comments on commit b0fa207

Please sign in to comment.