summaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-30 07:40:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-30 07:40:57 +0000
commit6659aad3ef651b714a66d648cef2f25e3fff8516 (patch)
tree4f820edcddb221573b29f91a05786eabff94dd7a /app/models/user.rb
parent5e28f0b1b6aaabb327d458213f14cf6e5b90ae8a (diff)
downloadredmine-6659aad3ef651b714a66d648cef2f25e3fff8516.tar.gz
redmine-6659aad3ef651b714a66d648cef2f25e3fff8516.zip
Adds a role setting that viewing all or own time entries (#8929).
git-svn-id: http://svn.redmine.org/redmine/trunk@14275 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index ebfd02ea0..cdaebcf9e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -634,6 +634,12 @@ class User < Principal
allowed_to?(action, nil, options.reverse_merge(:global => true), &block)
end
+ def allowed_to_view_all_time_entries?(context)
+ allowed_to?(:view_time_entries, context) do |role, user|
+ role.time_entries_visibility == 'all'
+ end
+ end
+
# Returns true if the user is allowed to delete the user's own account
def own_account_deletable?
Setting.unsubscribe? &&