Sha256: 106c1609e72dea24316cf19cbc797e606fd9921422075aca8f7779b1e305760d

Contents?: true

Size: 785 Bytes

Versions: 38

Compression:

Stored size: 785 Bytes

Contents

module Maestrano
  module SSO
    module Group
      def find_for_maestrano_auth(auth)
        # E.g with Rails
        # where(auth.slice(:provider, :uid)).first_or_create do |group|
        #   group.provider = auth[:provider]
        #   group.uid = auth[:uid]
        #   group.name = (auth[:info][:company_name] || 'Your Group')
        #   group.country = auth[:info][:country]
        # end
        raise NoMethodError, "You need to override find_for_maestrano_auth in your #{self.class.name} model"
      end
      
      def maestrano?
        if self.respond_to?(:provider)
          return self.provider.to_s == 'maestrano'
        else
          raise NoMethodError, "You need to override maestrano? in your #{self.class.name} model"
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
maestrano-1.0.6 lib/maestrano/sso/group.rb
maestrano-1.0.5 lib/maestrano/sso/group.rb
maestrano-1.0.4 lib/maestrano/sso/group.rb
maestrano-1.0.3 lib/maestrano/sso/group.rb
maestrano-1.0.2 lib/maestrano/sso/group.rb
maestrano-1.0.1 lib/maestrano/sso/group.rb
maestrano-1.0.0 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC9 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC8 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC7 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC6 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC5 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC4 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC3 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC2 lib/maestrano/sso/group.rb
maestrano-1.0.0.pre.RC1 lib/maestrano/sso/group.rb
maestrano-0.12.5 lib/maestrano/sso/group.rb
maestrano-0.12.4 lib/maestrano/sso/group.rb
maestrano-0.12.3 lib/maestrano/sso/group.rb
maestrano-0.12.2 lib/maestrano/sso/group.rb