Sha256: 87fe6dadc8bb1d9ef442890051388f7c12ea5ba6284ffaf327958a524a845b2b

Contents?: true

Size: 436 Bytes

Versions: 4

Compression:

Stored size: 436 Bytes

Contents

module SocialStream
  module Oauth2Server
    module Ability
      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, :destroy], Site::Client do |c|
          c.allow? subject, 'manage'
        end

        can :read, Relation::Manager
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
social_stream-2.1.1 oauth2_server/lib/social_stream/oauth2_server/ability.rb
social_stream-oauth2_server-2.1.1 lib/social_stream/oauth2_server/ability.rb
social_stream-2.1.0 oauth2_server/lib/social_stream/oauth2_server/ability.rb
social_stream-oauth2_server-2.1.0 lib/social_stream/oauth2_server/ability.rb