summaryrefslogtreecommitdiff
path: root/app/controllers/master_controller.rb
blob: b2075d598effcb45483dc700510e8eb3471fdade (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

# The father class of all controllers that require the master role to fulfill requests.
class MasterController < AuthenticatedController
  before_action :assert_master_role

  private

  def assert_master_role
    return if current_user_account.role == 'master'

    render json: { error_message: 'No cuenta con los permisos necesarios' }, status: :forbidden
  end
end