Use CanCanCan for oauth clients controller

This commit is contained in:
Andy Allan 2019-01-09 15:34:54 +01:00
parent 425f42dd80
commit b184b39f34
2 changed files with 3 additions and 1 deletions

View file

@ -16,6 +16,7 @@ class Ability
if user if user
can :welcome, :site can :welcome, :site
can [:index, :new, :create, :show, :edit, :update, :destroy], ClientApplication
can [:create, :edit, :comment, :subscribe, :unsubscribe], DiaryEntry can [:create, :edit, :comment, :subscribe, :unsubscribe], DiaryEntry
can [:new, :create, :reply, :show, :inbox, :outbox, :mark, :destroy], Message can [:new, :create, :reply, :show, :inbox, :outbox, :mark, :destroy], Message
can [:close, :reopen], Note can [:close, :reopen], Note

View file

@ -3,7 +3,8 @@ class OauthClientsController < ApplicationController
before_action :authorize_web before_action :authorize_web
before_action :set_locale before_action :set_locale
before_action :require_user
authorize_resource :class => ClientApplication
def index def index
@client_applications = current_user.client_applications @client_applications = current_user.client_applications