module ActiveSambaLdap::SambaGroupEntry

Constants

DOMAIN_ADMINS_NAME

from source/rpc_server/srv_util.c in Samba

DOMAIN_ADMINS_RID

from source/include/rpc_misc.c in Samba

DOMAIN_COMPUTERS_NAME
DOMAIN_COMPUTERS_RID
DOMAIN_GUESTS_NAME
DOMAIN_GUESTS_RID
DOMAIN_USERS_NAME
DOMAIN_USERS_RID
LOCAL_ACCOUNT_OPERATORS_RID
LOCAL_ADMINS_RID
LOCAL_BACKUP_OPERATORS_RID
LOCAL_GUESTS_RID
LOCAL_POWER_USERS_RID
LOCAL_PRINT_OPERATORS_RID
LOCAL_REPLICATORS_RID
LOCAL_SYSTEM_OPERATORS_RID
LOCAL_USERS_RID
SID_BUILTIN

from librpc/ndr/security.h in Samba

TYPES

from source/librpc/idl/lsa.idl in Samba

WELL_KNOWN_NAMES
WELL_KNOWN_RIDS

Public Class Methods

included(base) click to toggle source
Calls superclass method
# File lib/active_samba_ldap/samba_group_entry.rb, line 7
def self.included(base)
  super
  base.extend(ClassMethods)
end

Public Instance Methods

change_gid_number(gid, allow_non_unique=false) click to toggle source
Calls superclass method
# File lib/active_samba_ldap/samba_group_entry.rb, line 101
def change_gid_number(gid, allow_non_unique=false)
  result = super
  return result unless samba_available?
  rid = self.class.gid2rid(gid_number)
  change_sid(rid, allow_non_unique)
end
change_gid_number_by_rid(rid, allow_non_unique=false) click to toggle source
# File lib/active_samba_ldap/samba_group_entry.rb, line 108
def change_gid_number_by_rid(rid, allow_non_unique=false)
  assert_samba_available
  change_gid_number(self.class.rid2gid(rid), allow_non_unique)
end
change_sid(rid, allow_non_unique=false) click to toggle source
# File lib/active_samba_ldap/samba_group_entry.rb, line 113
def change_sid(rid, allow_non_unique=false)
  assert_samba_available
  if (LOCAL_ADMINS_RID..LOCAL_REPLICATORS_RID).include?(rid.to_i)
    sid = "#{SID_BUILTIN}-#{rid}"
  else
    sid = "#{self.class.configuration[:sid]}-#{rid}"
  end
  # check_unique_sid_number(sid) unless allow_non_unique
  self.samba_sid = sid
end
change_type(type) click to toggle source
# File lib/active_samba_ldap/samba_group_entry.rb, line 129
def change_type(type)
  assert_samba_available
  normalized_type = type.to_s.downcase
  if samba4?
    self.group_type = ActiveDirectory::GroupType.resolve(normalized_type)
  else
    if TYPES.has_key?(normalized_type)
      type = TYPES[normalized_type]
    elsif TYPES.values.include?(type.to_i)
      # pass
    else
      # TODO: add available values
      raise ArgumentError, _("invalid type: %s") % type
    end
    self.samba_group_type = type.to_s
  end
end
fill_default_values(options={}) click to toggle source
Calls superclass method
# File lib/active_samba_ldap/samba_group_entry.rb, line 92
def fill_default_values(options={})
  if samba_available?
    options = options.stringify_keys
    change_type(options["group_type"] || "domain") unless samba_group_type
    self.display_name ||= options["display_name"] || cn
  end
  super
end
rid() click to toggle source
# File lib/active_samba_ldap/samba_group_entry.rb, line 124
def rid
  assert_samba_available
  Integer(samba_sid.split(/-/).last)
end
set_object_category() click to toggle source
# File lib/active_samba_ldap/samba_group_entry.rb, line 147
def set_object_category
  _base = ActiveSambaLdap::Base.base
  self.object_category = "cn=Group,cn=Schema,cn=Configuration,#{_base}"
end