mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-06 19:40:42 -05:00
Generated
Vendored
+1
@@ -47,6 +47,7 @@ type Config struct {
|
||||
ListOCMShares bool `mapstructure:"list_ocm_shares"`
|
||||
Notifications map[string]interface{} `mapstructure:"notifications"`
|
||||
IncludeOCMSharees bool `mapstructure:"include_ocm_sharees"`
|
||||
ShowEmailInResults bool `mapstructure:"show_email_in_results"`
|
||||
}
|
||||
|
||||
// Init sets sane defaults
|
||||
|
||||
Generated
Vendored
+17
@@ -40,6 +40,7 @@ type Handler struct {
|
||||
gatewayAddr string
|
||||
additionalInfoAttribute string
|
||||
includeOCMSharees bool
|
||||
showUserEmailInResults bool
|
||||
}
|
||||
|
||||
// Init initializes this and any contained handlers
|
||||
@@ -47,6 +48,7 @@ func (h *Handler) Init(c *config.Config) {
|
||||
h.gatewayAddr = c.GatewaySvc
|
||||
h.additionalInfoAttribute = c.AdditionalInfoAttribute
|
||||
h.includeOCMSharees = c.IncludeOCMSharees
|
||||
h.showUserEmailInResults = c.ShowEmailInResults
|
||||
}
|
||||
|
||||
// FindSharees implements the /apps/files_sharing/api/v1/sharees endpoint
|
||||
@@ -123,6 +125,21 @@ func (h *Handler) FindSharees(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
if !h.showUserEmailInResults {
|
||||
for _, m := range userMatches {
|
||||
m.Value.ShareWithAdditionalInfo = m.Value.ShareWith
|
||||
}
|
||||
for _, m := range exactUserMatches {
|
||||
m.Value.ShareWithAdditionalInfo = m.Value.ShareWith
|
||||
}
|
||||
for _, m := range groupMatches {
|
||||
m.Value.ShareWithAdditionalInfo = m.Value.ShareWith
|
||||
}
|
||||
for _, m := range exactGroupMatches {
|
||||
m.Value.ShareWithAdditionalInfo = m.Value.ShareWith
|
||||
}
|
||||
}
|
||||
|
||||
response.WriteOCSSuccess(w, r, &conversions.ShareeData{
|
||||
Exact: &conversions.ExactMatchesData{
|
||||
Users: exactUserMatches,
|
||||
|
||||
Reference in New Issue
Block a user