Class: OpenWFE::DefaultAuthSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/openwfe/worklist/worklist.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash = nil) ⇒ DefaultAuthSystem

Returns a new instance of DefaultAuthSystem.



276
277
278
# File 'lib/openwfe/worklist/worklist.rb', line 276

def initialize (hash=nil)
    @hash = hash
end

Instance Method Details

#authenticate(user, pass) ⇒ Object



280
281
282
283
# File 'lib/openwfe/worklist/worklist.rb', line 280

def authenticate (user, pass)
    return true unless @hash
    pass == @hash[user]
end

#authorized?(user, store_name, action) ⇒ Boolean

Returns:

  • (Boolean)


285
286
287
288
# File 'lib/openwfe/worklist/worklist.rb', line 285

def authorized? (user, store_name, action)
    return true unless @hash
    @hash[user] != nil
end