Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate owner data in the ocs and ocdav services #2233

Merged
merged 3 commits into from
Feb 7, 2022

Conversation

ishank011
Copy link
Contributor

No description provided.

@ishank011 ishank011 force-pushed the ocs-user-data branch 2 times, most recently from 57da2eb to ef7889b Compare November 3, 2021 16:11
Copy link
Contributor

@butonic butonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only fetch owner info when needed

diff --git a/internal/http/services/owncloud/ocdav/propfind.go b/internal/http/services/owncloud/ocdav/propfind.go
--- internal/http/services/owncloud/ocdav/propfind.go
+++ internal/http/services/owncloud/ocdav/propfind.go
@@ -482,15 +482,8 @@
 		)
 		sublog.Debug().Interface("role", role).Str("dav-permissions", wdp).Msg("converted PermissionSet")
 	}
 
-	var ownerUsername, ownerDisplayName string
-	owner, err := s.getOwnerInfo(ctx, md.Owner)
-	if err == nil {
-		ownerUsername = owner.Username
-		ownerDisplayName = owner.DisplayName
-	}
-
 	propstatOK := propstatXML{
 		Status: "HTTP/1.1 200 OK",
 		Prop:   []*propertyXML{},
 	}
@@ -593,8 +586,16 @@
 		}
 		// TODO return other properties ... but how do we put them in a namespace?
 	} else {
 		// otherwise return only the requested properties
+
+		var ownerUsername, ownerDisplayName string
+		owner, err := s.getOwnerInfo(ctx, md.Owner)
+		if err == nil {
+			ownerUsername = owner.Username
+			ownerDisplayName = owner.DisplayName
+		}
+
 		for i := range pf.Prop {
 			switch pf.Prop[i].Space {
 			case _nsOwncloud:
 				switch pf.Prop[i].Local {

I cannot commit to your PR and was doing this in github.dev ... which did not allow me to select your repo for a PR ... so ... here is a diff 🤷

@ishank011
Copy link
Contributor Author

@butonic done!

@labkode labkode requested a review from butonic November 10, 2021 10:14
labkode
labkode previously approved these changes Nov 18, 2021
@butonic butonic merged commit 8dc78c6 into cs3org:master Feb 7, 2022
@ishank011 ishank011 deleted the ocs-user-data branch February 7, 2022 09:26
ishank011 added a commit to cernbox/reva that referenced this pull request Feb 16, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Feb 22, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Feb 23, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Feb 25, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Feb 25, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Feb 25, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Feb 28, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 1, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 1, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 2, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 2, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 2, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 3, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 3, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 3, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 10, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 15, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Mar 30, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Apr 26, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request May 2, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request May 5, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request May 12, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request May 31, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Jun 8, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Jun 8, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Jun 13, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Jun 13, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Jun 13, 2022
ishank011 added a commit to cernbox/reva that referenced this pull request Jun 13, 2022
labkode pushed a commit to labkode/reva that referenced this pull request Jun 29, 2022
labkode pushed a commit to cernbox/reva that referenced this pull request Jul 8, 2022
labkode pushed a commit to cernbox/reva that referenced this pull request Jul 11, 2022
labkode added a commit that referenced this pull request Jul 11, 2022
…ices (#2233)" (#3056)

This reverts commit 8dc78c6.

Co-authored-by: Ishank Arora <ishank011@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants