summaryrefslogtreecommitdiff
path: root/app/controllers/teams_controller.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/controllers/teams_controller.rb
parentd6009eddd6f67a9414ff7d707ae82c053e6653ad (diff)
Implement the new security mechanism
Diffstat (limited to 'app/controllers/teams_controller.rb')
-rw-r--r--app/controllers/teams_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/teams_controller.rb b/app/controllers/teams_controller.rb
index 05e7a12..57ae256 100644
--- a/app/controllers/teams_controller.rb
+++ b/app/controllers/teams_controller.rb
@@ -1,5 +1,4 @@
class TeamsController < ApplicationController
- before_action :set_team, only: [:show, :edit, :update, :destroy]
# GET /teams
# GET /teams.json
@@ -71,4 +70,8 @@ class TeamsController < ApplicationController
def team_params
params.require(:team).permit(:match_id)
end
+
+ def is_owner?(object)
+ object.users.include?(current_user)
+ end
end