Class: Notee::RolesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/notee/roles_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#restrict_access_json, #set_request_filter

Instance Method Details

#indexObject



6
7
8
# File 'app/controllers/notee/roles_controller.rb', line 6

def index
  render json: { status: 'success', roles: User.roles }
end

#showObject



10
11
12
13
14
15
16
17
18
# File 'app/controllers/notee/roles_controller.rb', line 10

def show
  user = find_user_by_access_token

  if user
    render json: { status: 'success', role: user.role }
  else
    render json: { status: 'failed' }
  end
end