Module: SocialStream::Oauth2Server::Models::User

Extended by:
ActiveSupport::Concern
Defined in:
lib/social_stream/oauth2_server/models/user.rb

Instance Method Summary collapse

Instance Method Details

#client_authorize!(client) ⇒ Object

Create a new tie to Site::Client



27
28
29
30
31
# File 'lib/social_stream/oauth2_server/models/user.rb', line 27

def client_authorize!(client)
  unless contact_to!(client).relation_ids.include?(Relation::Auth.instance.id)
    contact_to!(client).relation_ids += [ Relation::Auth.instance.id ]
  end
end

#client_authorized?(client) ⇒ Boolean

Is #client authorized by this SocialStream::Oauth2Server::Models::User

Returns:

  • (Boolean)


22
23
24
# File 'lib/social_stream/oauth2_server/models/user.rb', line 22

def client_authorized?(client)
  contact_to!(client).relation_ids.include? Relation::Auth.instance.id
end