module SocialStream::Oauth2Server::Ability

Public Class Methods

new(subject) click to toggle source
Calls superclass method
# File lib/social_stream/oauth2_server/ability.rb, line 4
def initialize(subject)
  super

  can :read, Site::Client

  can :create, Site::Client do |c|
    subject.present? &&
      c.author_id == subject.actor_id
  end

  can [:update, :update_secret, :destroy], Site::Client do |c|
    c.allow? subject, 'manage'
  end

  can :read, Relation::Manager
end