Module: ActiveSambaLdap::SambaGroupEntry::ClassMethods

Defined in:
lib/active_samba_ldap/samba_group_entry.rb

Instance Method Summary collapse

Instance Method Details

#gid2rid(gid) ⇒ Object



69
70
71
72
73
74
75
76
# File 'lib/active_samba_ldap/samba_group_entry.rb', line 69

def gid2rid(gid)
  gid = Integer(gid)
  if WELL_KNOWN_RIDS.include?(gid)
    gid
  else
    2 * gid + 1001
  end
end

#rid2gid(rid) ⇒ Object



78
79
80
81
82
83
84
85
# File 'lib/active_samba_ldap/samba_group_entry.rb', line 78

def rid2gid(rid)
  rid = Integer(rid)
  if WELL_KNOWN_RIDS.include?(rid)
    rid
  else
    (rid - 1001) / 2
  end
end

#samba_object_classesObject



61
62
63
64
65
66
67
# File 'lib/active_samba_ldap/samba_group_entry.rb', line 61

def samba_object_classes
  if samba4?
    ["group"]
  else
    ["sambaGroupMapping"]
  end
end

#start_ridObject



87
88
89
# File 'lib/active_samba_ldap/samba_group_entry.rb', line 87

def start_rid
  gid2rid(start_gid)
end