Class: RailsEmbedEditor::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/rails_embed_editor/application_controller.rb

Direct Known Subclasses

EditorController

Instance Method Summary collapse

Instance Method Details

#_authorize(*args) ⇒ Object



12
13
14
15
16
17
18
19
# File 'app/controllers/rails_embed_editor/application_controller.rb', line 12

def _authorize(*args)
  begin
    _authorize! *args
    true
  rescue CanCan::AccessDenied => e
    false
  end
end

#_authorize!(*args) ⇒ Object



4
5
6
7
8
9
10
# File 'app/controllers/rails_embed_editor/application_controller.rb', line 4

def _authorize!(*args)
  if defined? current_user
    RailsEmbedEditor::Authorization.authorize!(current_user, *args)
  else
    true
  end
end