summaryrefslogtreecommitdiff
path: root/app/models/tournament.rb
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-04 20:35:16 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-04 20:35:16 -0400
commitbcfa571b0328a4b3e94479a31c027621ceb86ad5 (patch)
treeac662a6e8e6be36b311652520b8bcc2a1511741d /app/models/tournament.rb
parentd6009eddd6f67a9414ff7d707ae82c053e6653ad (diff)
Implement the new security mechanism
Diffstat (limited to 'app/models/tournament.rb')
-rw-r--r--app/models/tournament.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index 4483535..ecd551b 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -9,7 +9,7 @@ class Tournament < ActiveRecord::Base
end
def joinable_by?(user)
- return ((not user.nil?) and user.in_group?(:player) and open? and !players.include?(user))
+ return (open? and user.can?(:join_tournament) and !players.include?(user))
end
def join(user)