Sha256: 9bfcc0528d0572d87f9cfd04aece274bc8bee4b6d514f0f6910831dceb2dcae4
Contents?: true
Size: 543 Bytes
Versions: 16
Compression:
Stored size: 543 Bytes
Contents
require_dependency 'notee/application_controller' module Notee class RolesController < ApplicationController def index render json: { status: 'success', roles: User.roles } end def show user = find_user_by_access_token if user render json: { status: 'success', role: user.role } else render json: { status: 'failed' } end end private def find_user_by_access_token token = Token.find_by(access_token: session[:access_token]) token.user end end end
Version data entries
16 entries across 16 versions & 1 rubygems