Sha256: 3cf8911e3d167f3f9711fdf7aae36a4955c7303e1bbcbb3305b911f09677dcda

Contents?: true

Size: 452 Bytes

Versions: 6

Compression:

Stored size: 452 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, :update_secret, :destroy], Site::Client do |c|
          c.allow? subject, 'manage'
        end

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

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
social_stream-2.2.2 oauth2_server/lib/social_stream/oauth2_server/ability.rb
social_stream-oauth2_server-2.2.2 lib/social_stream/oauth2_server/ability.rb
social_stream-2.2.1 oauth2_server/lib/social_stream/oauth2_server/ability.rb
social_stream-oauth2_server-2.2.1 lib/social_stream/oauth2_server/ability.rb
social_stream-2.2.0 oauth2_server/lib/social_stream/oauth2_server/ability.rb
social_stream-oauth2_server-2.2.0 lib/social_stream/oauth2_server/ability.rb