プロジェクト

全般

プロフィール

Vote #72635

完了

User#allowed_to? should return true or false

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

ステータス:
Closed
優先度:
低め
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
56
issue_org_id:
12078
author_id:
4
assigned_to_id:
1
comments:
2
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

The attached patch fixes a minor bug in User.allowed_to?

Specifically, that method should return a boolean, but it actually sometimes returns a Role instead. This is because .detect is used when really .any? should be used.

I am not aware of this causing any serious issues, but I noticed this during debugging and was greatly confused when allowed_to? suddenly returned a Role ;).


journals

--------------------------------------------------------------------------------
Committed in r10614. Another change was required so that @User#allowed_to?@ return true or false and tests were updated.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン2.2.0_56 にセット

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

いいね!0
いいね!0