Skip to content

Commit 826aca6

Browse files
chore(gdpr): remove erasure request if actor not the user
1 parent ed50a9c commit 826aca6

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

extensions/gdpr/js/src/forum/extenders/extendUserSettingsPage.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ export default function extendUserSettingsPage() {
2727
override('flarum/forum/components/SettingsPage', 'dataItems', function (): ItemList<Mithril.Children> {
2828
const items = new ItemList<Mithril.Children>();
2929

30-
items.add(
31-
'gdprErasure',
32-
<div className="Form-group gdprErasure-container">
33-
<p className="helpText">{app.translator.trans('flarum-gdpr.forum.settings.request_erasure_help')}</p>
34-
<Button className="Button Button-gdprErasure" icon="fas fa-user-minus" onclick={() => app.modal.show(RequestErasureModal as any)}>
35-
{app.translator.trans('flarum-gdpr.forum.settings.request_erasure_button')}
36-
</Button>
37-
</div>,
38-
50
39-
);
30+
if (this.user === app.session.user) {
31+
items.add(
32+
'gdprErasure',
33+
<div className="Form-group gdprErasure-container">
34+
<p className="helpText">{app.translator.trans('flarum-gdpr.forum.settings.request_erasure_help')}</p>
35+
<Button className="Button Button-gdprErasure" icon="fas fa-user-minus" onclick={() => app.modal.show(RequestErasureModal as any)}>
36+
{app.translator.trans('flarum-gdpr.forum.settings.request_erasure_button')}
37+
</Button>
38+
</div>,
39+
50
40+
);
41+
}
4042

4143
items.add(
4244
'gdprExport',

0 commit comments

Comments
 (0)