title: how to set an ability for api resource without model cancancan
body: <p>My problem is that I do not understand how can I set an ability for resource without model. Since now I have single api controller </p>
  
  <pre><code>class Api::V1::ProfilesController &lt; Api::V1::BaseController   
  
    before_action :doorkeeper_authorize! 
  
    authorize_resource class: User
    respond_to :json
  
    api :GET, '/profiles', "This is index for all registered users except current user" 
    def index    
      render json: User.where.not(id: current_resource_owner.id)   
    end 
  
    api :GET, '/profiles/me', "This is current user profile's data"
    def me    
      render json: current_resource_owner      
    end
  
    protected
    def current_resource_owner
      @current_resource_owner ||= User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token
    end
  end
  </code></pre>
  
  <p>In this case Profile is not a model it's only a controller(api resource) Also I have a cancan ability </p>
  
  <pre><code>can :me, User, id: user.id
  can **index????**, User, id: user.id
  </code></pre>
  
  <p>It wasn't tricky to set an ability for custom <em>me</em> action, but how to set it for :index only in Profiles controller( cause I do already have set abilities for UsersController, which also has <em>:index</em> action and I do not want to change them )</p>
  
  <p>I'm just a beginner so please forgive me if my explanations are not so straight-forward( I can write some additional explanations if requested) and for my English</p>