Use CanCanCan for oauth clients controller
This commit is contained in:
parent
425f42dd80
commit
b184b39f34
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue