Module: ActiveSambaLdap::GroupEntry::ClassMethods

Defined in:
lib/active_samba_ldap/group_entry.rb

Instance Method Summary collapse

Instance Method Details

#find_by_gid_number(number) ⇒ Object



32
33
34
# File 'lib/active_samba_ldap/group_entry.rb', line 32

def find_by_gid_number(number)
  find(:first, :filter => ["gidNumber", Integer(number)])
end

#find_by_name_or_gid_number(key) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/active_samba_ldap/group_entry.rb', line 19

def find_by_name_or_gid_number(key)
  group = nil
  begin
    gid_number = Integer(key)
    group = find_by_gid_number(gid_number)
    raise GidNumberDoesNotExist.new(gid_number) if group.nil?
  rescue ArgumentError
    raise GroupDoesNotExist.new(key) unless exists?(key)
    group = find(key)
  end
  group
end

#ldap_mapping(options = {}) ⇒ Object



13
14
15
16
17
# File 'lib/active_samba_ldap/group_entry.rb', line 13

def ldap_mapping(options={})
  options = default_options.merge(options)
  super(extract_ldap_mapping_options(options))
  init_associations(options)
end

#unix_object_classesObject



36
37
38
39
40
41
42
# File 'lib/active_samba_ldap/group_entry.rb', line 36

def unix_object_classes
  if samba4?
    samba_object_classes
  else
    ["posixGroup"]
  end
end