Sha256: adfc996a43065b19c772e50b03ea48997c504741dc6bcec01c80d7704869f744

Contents?: true

Size: 352 Bytes

Versions: 23

Compression:

Stored size: 352 Bytes

Contents

module Rasti
  class App
    class User

      attr_reader :name, :permissions

      def initialize(attributes={})
        @name = attributes[:name]
        @permissions = attributes.fetch(:permissions, [])
      end

      def authorized?(permission)
        permissions.any? { |p| Permission.new(p).include? permission }
      end

    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rasti-app-11.0.0 lib/rasti/app/user.rb
rasti-app-10.0.1 lib/rasti/app/user.rb
rasti-app-10.0.0 lib/rasti/app/user.rb
rasti-app-9.0.0 lib/rasti/app/user.rb
rasti-app-8.0.1 lib/rasti/app/user.rb
rasti-app-8.0.0 lib/rasti/app/user.rb
rasti-app-7.1.1 lib/rasti/app/user.rb
rasti-app-7.1.0 lib/rasti/app/user.rb
rasti-app-7.0.2 lib/rasti/app/user.rb
rasti-app-7.0.1 lib/rasti/app/user.rb
rasti-app-7.0.0 lib/rasti/app/user.rb
rasti-app-6.0.1 lib/rasti/app/user.rb
rasti-app-6.0.0 lib/rasti/app/user.rb
rasti-app-5.0.0 lib/rasti/app/user.rb
rasti-app-4.0.2 lib/rasti/app/user.rb
rasti-app-4.0.1 lib/rasti/app/user.rb
rasti-app-4.0.0 lib/rasti/app/user.rb
rasti-app-3.0.0 lib/rasti/app/user.rb
rasti-app-2.2.4 lib/rasti/app/user.rb
rasti-app-2.2.3 lib/rasti/app/user.rb