summaryrefslogtreecommitdiffstats
path: root/lib/redmine/access_control.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-09-25 18:51:03 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-09-25 18:51:03 +0000
commit394fc9c10945e6890bad1e5627a7e78a33c3612b (patch)
tree8eb92706b5648d5b62213f915c5fced11bd937b1 /lib/redmine/access_control.rb
parent21979cf68a71a1f4a06857e3363e9ddac0eafb66 (diff)
downloadredmine-394fc9c10945e6890bad1e5627a7e78a33c3612b.tar.gz
redmine-394fc9c10945e6890bad1e5627a7e78a33c3612b.zip
Fixed: cross-project issue list should not show issues of projects for which the issue tracking module was disabled.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1907 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/access_control.rb')
-rw-r--r--lib/redmine/access_control.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/redmine/access_control.rb b/lib/redmine/access_control.rb
index f5b25f277..25cf63d61 100644
--- a/lib/redmine/access_control.rb
+++ b/lib/redmine/access_control.rb
@@ -30,8 +30,15 @@ module Redmine
@permissions
end
+ # Returns the permission of given name or nil if it wasn't found
+ # Argument should be a symbol
+ def permission(name)
+ permissions.detect {|p| p.name == name}
+ end
+
+ # Returns the actions that are allowed by the permission of given name
def allowed_actions(permission_name)
- perm = @permissions.detect {|p| p.name == permission_name}
+ perm = permission(permission_name)
perm ? perm.actions : []
end
@@ -94,6 +101,7 @@ module Redmine
@actions << "#{controller}/#{actions}"
end
end
+ @actions.flatten!
end
def public?