LdapFluff::Posix

Public Class Methods

new(config = {}) click to toggle source
# File lib/ldap_fluff/posix.rb, line 3
def initialize(config = {})
  @base           = config.base_dn
  super
end

Public Instance Methods

bind?(uid = nil, password = nil) click to toggle source
# File lib/ldap_fluff/posix.rb, line 8
def bind?(uid = nil, password = nil)
  @ldap.bind_as(:filter => "(uid=#{uid})", :password => password)
end
is_in_groups(uid, gids = [], all = true) click to toggle source

returns whether a user is a member of ALL or ANY particular groups note: this method is much faster than groups_for_uid

gids should be an array of group common names

returns true if owner is in ALL of the groups if all=true, otherwise returns true if owner is in ANY of the groups

# File lib/ldap_fluff/posix.rb, line 19
def is_in_groups(uid, gids = [], all = true)
  (gids.empty? || @member_service.times_in_groups(uid, gids, all) > 0)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.