Sha256: 7ce205f579278da60f456f29c06e3b02b585e2172d0e1a6cf6dc9d65546d6399

Contents?: true

Size: 723 Bytes

Versions: 14

Compression:

Stored size: 723 Bytes

Contents

module Shamu
  module Security

    # Used to determine the roles that the current {Principal} should be given
    # on a {Services::Service}.
    module RolesService

      # @!visibility private
      def self.create( scorpion, * )
        scorpion.new EmptyRolesService
      end

      # @param [Principal] principal of the currently logged in user.
      # @return [Array<Symbol>] the roles granted to the principal.
      def roles_for( principal )
        []
      end

      # Default {RolesService} always returns an empty set.
      class EmptyRolesService
        include RolesService

        # (see RolesService#roles_for)
        def roles_for( principal )
          []
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
shamu-0.0.19 lib/shamu/security/roles_service.rb
shamu-0.0.18 lib/shamu/security/roles_service.rb
shamu-0.0.17 lib/shamu/security/roles_service.rb
shamu-0.0.15 lib/shamu/security/roles_service.rb
shamu-0.0.14 lib/shamu/security/roles_service.rb
shamu-0.0.13 lib/shamu/security/roles_service.rb
shamu-0.0.11 lib/shamu/security/roles_service.rb
shamu-0.0.9 lib/shamu/security/roles_service.rb
shamu-0.0.8 lib/shamu/security/roles_service.rb
shamu-0.0.7 lib/shamu/security/roles_service.rb
shamu-0.0.5 lib/shamu/security/roles_service.rb
shamu-0.0.4 lib/shamu/security/roles_service.rb
shamu-0.0.3 lib/shamu/security/roles_service.rb
shamu-0.0.2 lib/shamu/security/roles_service.rb