Module: Uncouple::Action::Authorization

Included in:
Uncouple::Action
Defined in:
lib/uncouple/action/authorization.rb

Instance Method Summary collapse

Instance Method Details

#authorize!Object



9
10
11
12
# File 'lib/uncouple/action/authorization.rb', line 9

def authorize!
  # overwrite me!
  true
end

#current_userObject



14
15
16
# File 'lib/uncouple/action/authorization.rb', line 14

def current_user
  @current_user ||= params.delete(:current_user)
end

#perform_with_authorizationObject



5
6
7
# File 'lib/uncouple/action/authorization.rb', line 5

def perform_with_authorization
  perform if authorize!
end