Module: ActiveSambaLdap::ActiveDirectory::GroupType

Defined in:
lib/active_samba_ldap/active_directory.rb

Constant Summary collapse

GLOBAL_GROUP =
0x2
DOMAIN_LOCAL_GROUP =
0x4
UNIVERSAL_GROUP =
0x8
SECURITY_ENABLED =
0x80000000

Class Method Summary collapse

Class Method Details

.resolve(name, security_enabled = true) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/active_samba_ldap/active_directory.rb', line 47

def resolve(name, security_enabled=true)
  type = 0
  case name.to_s
  when "global"
    type = GLOBAL_GROUP
  when /\Adomain[-_]local\z/
    type = DOMAIN_LOCAL_GROUP
  when "universal"
    type = UNIVERSAL_GROUP
  else
    # TODO: I18N
    raise ArgumentError, "unknown group type: #{name.inspect}: " +
                         "available: [:global, :domain_local, :universal]"
  end
  type |= SECURITY_ENABLED if security_enabled
  [type].pack("L").unpack("l")[0]
end