Sha256: 1be2d095b387c4b19b67a6d087a3f1d429c2a564efd57d0a27413d1f7c9bde8b

Contents?: true

Size: 527 Bytes

Versions: 9

Compression:

Stored size: 527 Bytes

Contents

module Puavo
  module Authorization
    def self.current_user
      Thread.current["current_user"]
    end
    
    def self.current_user=(user)
      Thread.current["current_user"] = user
      # Update owners list
      Thread.current["owners"] = LdapOrganisation.current.owner
    end

    def self.organisation_owner?
      if Puavo::Authorization.current_user && Thread.current["owners"]
        return Thread.current["owners"].include?(Puavo::Authorization.current_user.dn)
      end
      return false
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
puavo_authentication-0.0.19 lib/puavo/authorization.rb
puavo_authentication-0.0.18 lib/puavo/authorization.rb
puavo_authentication-0.2.0 lib/puavo/authorization.rb
puavo_authentication-0.1.0 lib/puavo/authorization.rb
puavo_authentication-0.0.17 lib/puavo/authorization.rb
puavo_authentication-0.0.16 lib/puavo/authorization.rb
puavo_authentication-0.0.15 lib/puavo/authorization.rb
puavo_authentication-0.0.13 lib/puavo/authorization.rb
puavo_authentication-0.0.11 lib/puavo/authorization.rb