summaryrefslogtreecommitdiffstats
path: root/app/models/role.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-19 11:57:35 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-19 11:57:35 +0000
commit6bd8970afb045e836789679c52b57f6a789c964e (patch)
tree8c7c3af610f3f7c5ba02d1c3b71788bebab6ad95 /app/models/role.rb
parent5c2925bea66349ecefcf32f507ccef55017dbcfe (diff)
downloadredmine-6bd8970afb045e836789679c52b57f6a789c964e.tar.gz
redmine-6bd8970afb045e836789679c52b57f6a789c964e.zip
Merged r22063 from trunk to 4.2-stable (#38070).
git-svn-id: https://svn.redmine.org/redmine/branches/4.2-stable@22065 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/role.rb')
-rw-r--r--app/models/role.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/role.rb b/app/models/role.rb
index 54d69c24f..5cdc593e9 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -226,6 +226,8 @@ class Role < ActiveRecord::Base
# Returns true if tracker_id belongs to the list of
# trackers for which permission is given
def permissions_tracker_ids?(permission, tracker_id)
+ return false unless has_permission?(permission)
+
permissions_tracker_ids(permission).include?(tracker_id)
end
@@ -239,6 +241,8 @@ class Role < ActiveRecord::Base
# Returns true if permission is given for all trackers
def permissions_all_trackers?(permission)
+ return false unless has_permission?(permission)
+
permissions_all_trackers[permission.to_s].to_s != '0'
end