[#488] Sync using oid.ID

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-06-27 12:33:36 +03:00 committed by Alex Vanin
parent 85c203e157
commit c88a9842db
18 changed files with 224 additions and 139 deletions

View file

@ -174,7 +174,7 @@ func (h *handler) GetObjectLegalHoldHandler(w http.ResponseWriter, r *http.Reque
}
legalHold := &data.LegalHold{Status: legalHoldOff}
if lockInfo.LegalHoldOID != nil {
if lockInfo.IsLegalHoldSet() {
legalHold.Status = legalHoldOn
}
@ -248,16 +248,16 @@ func (h *handler) GetObjectRetentionHandler(w http.ResponseWriter, r *http.Reque
return
}
if lockInfo.RetentionOID == nil {
if !lockInfo.IsRetentionSet() {
h.logAndSendError(w, "retention lock isn't set", reqInfo, apiErrors.GetAPIError(apiErrors.ErrNoSuchKey))
return
}
retention := &data.Retention{
Mode: governanceMode,
RetainUntilDate: lockInfo.UntilDate,
RetainUntilDate: lockInfo.UntilDate(),
}
if lockInfo.IsCompliance {
if lockInfo.IsCompliance() {
retention.Mode = complianceMode
}