summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index d5752aa..d416c94 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -14,7 +14,7 @@ class ApplicationController < ActionController::Base
include SimpleCaptcha::ControllerHelpers
def check_permission(verb, object=nil)
- unless current_user.can?((verb.to_s+"_"+noun).to_sym) or (!object.nil? and is_owner?(object))
+ unless current_user.can?("#{verb.to_s}_#{noun}".to_sym) or object.try(:check_permission, current_user, verb)
respond_to do |format|
format.html do
if object.nil?
@@ -47,9 +47,4 @@ class ApplicationController < ActionController::Base
object = send("set_"+noun)
check_permission(:edit, object)
end
-
- # Override this
- def is_owner?(object)
- return false
- end
end