[Sanity test]- skip owner permission in onedrive restore check (#3103)
<!-- PR description--> for Sanity test - skip owner permission in onedrive restore check #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [ ] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * https://github.com/alcionai/corso/issues/3081 #### Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
b1606466c2
commit
51b3f25311
2
.github/workflows/sanity-test.yaml
vendored
2
.github/workflows/sanity-test.yaml
vendored
@ -51,6 +51,8 @@ jobs:
|
|||||||
|
|
||||||
- run: mkdir test_results
|
- run: mkdir test_results
|
||||||
|
|
||||||
|
- run: mkdir testlog
|
||||||
|
|
||||||
# run the tests
|
# run the tests
|
||||||
- name: Version Test
|
- name: Version Test
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@ -354,7 +354,7 @@ func checkOnedriveRestoration(
|
|||||||
getRestoreData(ctx, client, *drive.GetId(), restoreFolderID, restoreFile, restoreFolderPermission, startTime)
|
getRestoreData(ctx, client, *drive.GetId(), restoreFolderID, restoreFile, restoreFolderPermission, startTime)
|
||||||
|
|
||||||
for folderName, permissions := range folderPermission {
|
for folderName, permissions := range folderPermission {
|
||||||
logger.Ctx(ctx).Info("checking for folder: %s \n", folderName)
|
logger.Ctx(ctx).Info("checking for folder: ", folderName, "\n")
|
||||||
fmt.Printf("checking for folder: %s \n", folderName)
|
fmt.Printf("checking for folder: %s \n", folderName)
|
||||||
|
|
||||||
restoreFolderPerm := restoreFolderPermission[folderName]
|
restoreFolderPerm := restoreFolderPermission[folderName]
|
||||||
@ -488,17 +488,24 @@ func permissionIn(
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
gv2 = perm.GetGrantedToV2()
|
gv2 = perm.GetGrantedToV2()
|
||||||
perInfo = permissionInfo{}
|
perInfo = permissionInfo{}
|
||||||
|
entityID string
|
||||||
)
|
)
|
||||||
|
|
||||||
if gv2.GetUser() != nil {
|
if gv2.GetUser() != nil {
|
||||||
perInfo.entityID = ptr.Val(gv2.GetUser().GetId())
|
entityID = ptr.Val(gv2.GetUser().GetId())
|
||||||
} else if gv2.GetGroup() != nil {
|
} else if gv2.GetGroup() != nil {
|
||||||
perInfo.entityID = ptr.Val(gv2.GetGroup().GetId())
|
entityID = ptr.Val(gv2.GetGroup().GetId())
|
||||||
}
|
}
|
||||||
|
|
||||||
perInfo.roles = perm.GetRoles()
|
roles := perm.GetRoles()
|
||||||
|
for _, role := range roles {
|
||||||
|
if role != "owner" {
|
||||||
|
perInfo.entityID = entityID
|
||||||
|
perInfo.roles = append(perInfo.roles, role)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
slices.Sort(perInfo.roles)
|
slices.Sort(perInfo.roles)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user