Module: ActiveSambaLdap::SambaAccountEntry::ClassMethods::PrimaryGroupProxy

Defined in:
lib/active_samba_ldap/samba_account_entry.rb

Instance Method Summary collapse

Instance Method Details

#replace(entry) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/active_samba_ldap/samba_account_entry.rb', line 70

def replace(entry)
  result = super
  return result unless @owner.samba_available?

  if @target and @target.samba_available?
    if @target.samba_sid.to_s.empty?
      raise GroupDoesNotHaveSambaSID.new(@target.gid_number)
    end
    @owner.samba_primary_group_sid = @target.samba_sid
  else
    @owner.samba_primary_group_sid = nil
  end

  result
end