プロジェクト

全般

プロフィール

Vote #78353

完了

Forbid to edit/update/delete the anonymous user

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Accounts / authentication_7
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
7
version_id:
119
issue_org_id:
25483
author_id:
2784
assigned_to_id:
1
comments:
4
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Right now, an admin can (in principal) edit and even delete the Anonymous user via the UserController since it doesn't restrict its query to logged users. This should not be possible and doesn't seem to be intended from the surrounding code:

  • When showing the edit form for the anonymous user, a template error occurs in @app/views/users/_general.html.erb@.
  • When deleting the anonynmous user, all its objects will be assigned to itself and the user gets deleted. While it will be automatically recreated on next access, all its issues, journals, ... will have dangling @user_ids@ pointing to the old anonymous user.

The attached patch restricts edit/update/delete of users to logged users. Displaying the user page of Anonymous is still supported. The Patch was extracted from "Planio":https://plan.io/redmine-hosting.


journals

Confirmed the problem. Setting target version to 3.4.0.
Thank you for sharing the patch.
--------------------------------------------------------------------------------
Patch committed, thanks!
--------------------------------------------------------------------------------
Holger Just wrote:

> * When deleting the anonynmous user, all its objects will be assigned to itself and the user gets deleted. While it will be automatically recreated on next access, all its issues, journals, ... will have dangling @user_ids@ pointing to the old anonymous user.

FTR, I was not able to reproduce this behaviour as @AnonymousUser#destroy@ does nothing and returns false.
--------------------------------------------------------------------------------
Ah, because @AnonymousUser#destroy@ is indeed overwritten to do nothing (i.e. just @return false@). All the hooks would still run which might have unwanted consequences, thus stis patch is still absolutely warranted.
--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリAccounts / authentication_7 にセット
  • 対象バージョン3.4.0_119 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0