Class: ProtectedRecordManager::ApplicationController

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

Direct Known Subclasses

ChangeRequestsController

Instance Method Summary collapse

Instance Method Details

#ensure_record_managerObject



3
4
5
6
# File 'app/controllers/protected_record_manager/application_controller.rb', line 3

def ensure_record_manager
  current_user || not_found
  current_user.protected_record_manager || not_found
end

#not_foundObject



8
9
10
# File 'app/controllers/protected_record_manager/application_controller.rb', line 8

def not_found
  render status: 403, text: 'Resource does not exist, or user lacks required permissions.' and return
end