public string FormatBody(Node node, SharingData sharingData, string siteUrl, string body)
        {
            //TODO: send a site-relative path
            // Alternative: send an absolute path, but when a request arrives
            // containing a share guid, redirect to the more compact and readable path.
            var url = $"{siteUrl?.TrimEnd('/')}{node.Path}?share={sharingData.Id}";

            // sharing level info: Open, Edit, etc.
            var levelText = SR.GetString("$Sharing:SharingLevel_" + sharingData.Level);

            return(string.Format(body, url, levelText));
        }
Exemplo n.º 2
0
 public static SafeSharingData Create(SharingData sharingData)
 {
     // clone the shared data, but hide inaccessible identities
     return(sharingData == null ? null : new SafeSharingData
     {
         Id = sharingData.Id,
         Token = sharingData.Token,
         Identity = GetSafeIdentity(sharingData.Identity),
         Mode = sharingData.Mode,
         Level = sharingData.Level,
         CreatorId = GetSafeIdentity(sharingData.CreatorId),
         ShareDate = sharingData.ShareDate
     });
 }
 public string FormatSubject(Node node, SharingData sharingData, string subject)
 {
     // default implementation: static subject
     return(subject);
 }