diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-09-30 11:42:36 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-09-30 11:42:36 +0000 |
commit | 91d7916f389664029adca1e42851e7b008ec7d40 (patch) | |
tree | 4551df885151f9b5a7378f3d64560ef9cbdf1c83 /app/models/issue.rb | |
parent | edc94dabb34296c8417bfa5d67d1b445fed13065 (diff) | |
download | redmine-91d7916f389664029adca1e42851e7b008ec7d40.tar.gz redmine-91d7916f389664029adca1e42851e7b008ec7d40.zip |
code cleanup: rubocop: fix Layout/ElseAlignment in Issue class visible? method
git-svn-id: http://svn.redmine.org/redmine/trunk@18566 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 9ccf310e9..7da5c9fc7 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -152,20 +152,21 @@ class Issue < ActiveRecord::Base # Returns true if usr or current user is allowed to view the issue def visible?(usr=nil) (usr || User.current).allowed_to?(:view_issues, self.project) do |role, user| - visible = if user.logged? - case role.issues_visibility - when 'all' - true - when 'default' - !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to)) - when 'own' - self.author == user || user.is_or_belongs_to?(assigned_to) + visible = + if user.logged? + case role.issues_visibility + when 'all' + true + when 'default' + !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to)) + when 'own' + self.author == user || user.is_or_belongs_to?(assigned_to) + else + false + end else - false + !self.is_private? end - else - !self.is_private? - end unless role.permissions_all_trackers?(:view_issues) visible &&= role.permissions_tracker_ids?(:view_issues, tracker_id) end |