Sha256: b6682f275700a3238c08704722671e0e1e9eed1e06c7627b1e1da99a3f00e7d4

Contents?: true

Size: 474 Bytes

Versions: 15

Compression:

Stored size: 474 Bytes

Contents

module Applicaster
  class Accounts
    class User
      include Virtus.model

      attribute :id, String
      attribute :name, String
      attribute :email, String
      attribute :global_roles, Array[String]
      attribute :permissions, Array[Permission]
      attribute :admin, Boolean

      def admin?
        !!admin
      end

      def permission_for_account_id(account_id)
        permissions.find { |p| p.account_id == account_id }
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
omniauth-applicaster-2.0.0 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.9.0 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.8.0 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.7.1 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.7.0 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.6.1 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.6.0 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.5.2 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.5.1 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.5.0 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.4.0 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.3.5 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.3.4 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.3.3 lib/applicaster/accounts/user.rb
omniauth-applicaster-1.3.2 lib/applicaster/accounts/user.rb